mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-03-14 16:26:52 +00:00
Updating chai will be done in a future PR as it requires overhauling all tests since chai is now ESM Change-type: patch
27 lines
947 B
TypeScript
27 lines
947 B
TypeScript
import chai from 'chai';
|
|
import sinonChai from 'sinon-chai';
|
|
import chaiThings from 'chai-things';
|
|
import chaiLike from 'chai-like';
|
|
|
|
/**
|
|
* Mocha runs this EXACTLY ONCE before all tests to set up globals that
|
|
* are used among all test files, such as chai assertion plugins. See
|
|
* https://mochajs.org/#test-fixture-decision-tree-wizard-thing
|
|
*
|
|
* IMPORTANT: The functionality in this global fixture hook should not break any
|
|
* suite run in isolation, and it should be required by ALL test suites.
|
|
* If unsure whether to add to global fixtures, refer to the chart above.
|
|
* Also, avoid setting global mutable variables here.
|
|
*/
|
|
export const mochaGlobalSetup = async function () {
|
|
console.log('Setting up global fixtures for tests...');
|
|
|
|
const { default: chaiAsPromised } = await import('chai-as-promised');
|
|
|
|
/* Setup chai assertion plugins */
|
|
chai.use(chaiAsPromised);
|
|
chai.use(sinonChai);
|
|
chai.use(chaiLike);
|
|
chai.use(chaiThings);
|
|
};
|