const { colors } = require("mocha/lib/reporters/base");
// This was supposed to change the color of failures (away from red which is hard to read) but it doesn't seem to work >:(
colors.fail = 32;

module.exports = {
	// require: preload cjs modules into mocha
	//  - esm: es6 module loader for node
	//  - spec/mochaHooks.ts: custom mocha hook which adds a polyfill for the `fin` object to the global
	require: ["esm", "spec/mochaHooks.ts"],
	// spec: tests to run
	spec: "./src/**/*.spec.ts",
	// exit: true to force exit, as without it, yarn test hangs.  Investigation with wtfnode showed that an open MessagePort
	// (i.e. not calling messagePort.close()) presumably in the router / SharedWorker may have been causing the hang.
	exit: true,
};
