Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
Describe the bug
Currently tns test command throws the following error in case when source code is not in src directory:
10 10 2019 11:34:38.105:ERROR [config]: Error in config file!
Error: The specified path to app directory /Users/havaluova/Work/sample-Groceries/src does not exist. Unable to find entry module.
at verifyEntryModuleDirectory (/Users/havaluova/Work/sample-Groceries/node_modules/nativescript-dev-webpack/index.js:163:15)
at Object.exports.getEntryModule (/Users/havaluova/Work/sample-Groceries/node_modules/nativescript-dev-webpack/index.js:29:5)
at module.exports.env (/Users/havaluova/Work/sample-Groceries/webpack.config.js:60:38)
at setWebpack (/Users/havaluova/Work/sample-Groceries/karma.conf.js:102:50)
at module.exports (/Users/havaluova/Work/sample-Groceries/karma.conf.js:77:3)
at Object.parseConfig (/Users/havaluova/Work/sample-Groceries/node_modules/karma/lib/config.js:393:5)
at new Server (/Users/havaluova/Work/sample-Groceries/node_modules/karma/lib/server.js:66:24)
at process.on (/Users/havaluova/Work/nativescript-cli/lib/services/karma-execution.js:6:160)
at process.emit (events.js:182:13)
at emit (internal/child_process.js:812:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Test run failed.
To Reproduce
There are 2 options to reproduce the issue:
https://github.com/NativeScript/sample-Groceriesnpm i && tns test iossrc to src1appPath to src1 inside nsconfig.jsontns test iosExpected behavior
The unit tests should be successfully executed.
Is this change available with a "next" version of the CLI on npm? When will it be available in latest?
Hey @jevenson,
The change is available in the rc version of the CLI. You can install it using npm i -g nativescript@rc. It'll be available officially in the next minor release of NativeScript which is planned in a few weeks.
Actually just updating CLI will not fix the problem if you have already executed tns test init command in your application. In such a situation, you need to manually include this change inside karma.config.js
Most helpful comment
Actually just updating CLI will not fix the problem if you have already executed
tns test initcommand in your application. In such a situation, you need to manually include this change inside karma.config.jshttps://github.com/NativeScript/nativescript-cli/blob/e75acf8f54051cd83a12615486cd4ddc455cd060/resources/test/karma.conf.js#L102