test/main.jsfile that requires
src/index.js. If I modify
src/index.jsthese changes are reflected in the subsequent test run triggered by the watcher. Would you mind opening an issue on Github so we can investigate this further?
@raghanag ts-mocha is a wrapper over mocha so not sure if completely follow that part. if its a TS issue we have an example TS mocha here https://github.com/mochajs/mocha-examples/tree/master/typescript.
The other part of ur question, u can create a
load-libs.js file which requires all your libs and use
mocha —require load-libs.js to load them before tests.
Does this help? if not pls supply more details about problem.
setup(...)function part of the mocha test library, I am looking at some code 4yo, and It seems this is part of mocha?
"test:unit": "TS_NODE_PROJECT='components/src/tsconfig.mocha.json' mocha -r ts-node/register components/src/**/*.spec.ts"
components/src/list-filter/list-filter-viewModel.ts:6:35 - error TS2307: Cannot find module 'ojL10n!./resources/nls/list-filter-strings'. 6 import * as componentStrings from 'ojL10n!./resources/nls/list-filter-strings';
loadFilesinto an async (promise returning) function, and, from what I'm seeing, all the run* stack too. This shouldn't be a problem, as Mocha supports Node>=8, which even has
async/awaitsupport, but it is a significant change (which I would be glad to implement). Not sure about browser support for this, though. (does Mocha support IE?)