Closed filipesilva closed 8 years ago
Yup, same error as Ward's.
My question is: If ng serve
builds the project succesfully, why ng test
doesn't? Are they building in a different way?
They might, yes. Investigating.
Possibly related: https://github.com/angular/angular/issues/4525
The explanation for why ng test
fails but serving and testing works seems to be that individual processes have a file descriptor limit (see http://stackoverflow.com/questions/31932729/open-too-many-files-emfile-error-in-windows-7). Thus running in separate doubles the file limit.
Further investigation shows that the problem occurs because of karma serving the files in dist/vendor/
.
Effectively, the process is watching those files files twice - once for rebuilding them and once for testing them.
I don't have a solution for this at the moment.
FYI, I changed my "test" npm-script to:
ng build && ng test --build=false
That's a good workaround until this is fixed.
@JohannesHoppe your solution is better than the one I put up in https://github.com/angular/angular-cli/pull/991/files. Would you be interested in making a PR replacing my warning?
Sure, I'll do that. :smile:
I think it should be ng build && ng test --build=false --watch=false
. There isn't much point keeping the tester in watch mode if the sources don't rebuild.
I still think separate ng serve + ng test processes are good for running tests in watch mode whereas the npm script change is better for running it once.
@JohannesHoppe your workaround works but only when running
>npm run test
Do you know how to achieve the same when running ?
>ng test
@filipesilva I tried to dig into angular-cli code but didn't found where it was specified :(
FYI
>ng --version
angular-cli: 1.0.0-beta.8
node: 6.2.1
os: win32 x64
Issue made obsolete by #1455.
YES!!! Webpack awesome thanks! Just ran into this this morning
I also have this issue and on Win10 and using ng test --watch=false
as a workaround
please guys, i am trying to run an ng test and i am getting the following error Missing 'angularCli.config' entry in Karma config Error: Missing 'angularCli.config' entry in Karma config
at init (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\angular-cli\plugins\karma.js:9:11)
at Array.invoke (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\di\lib\injector.js:75:15)
at Injector.get (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\di\lib\injector.js:48:43)
at C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\karma\lib\server.js:138:20
at Array.forEach (native)
at Server._start (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\karma\lib\server.js:137:21)
at Injector.invoke (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\di\lib\injector.js:75:15)
at Server.start (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\karma\lib\server.js:102:18)
at C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\angular-cli\tasks\test.js:30:25
at Class.run (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\angular-cli\tasks\test.js:15:16)
at Class.run (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\angular-cli\commands\test.js:29:25)
at Class.<anonymous> (C:\Users\Chisom\Documents\GitHub\OryxMCIv2\src\OryxMCI_web\node_modules\angular-cli\angular-cli\lib\models\command.js:152:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
here is my karma.config module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', 'angular-cli'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-remap-istanbul'), require('angular-cli/plugins/karma') ], files: [ { pattern: './src/test.ts', watched: false } ], preprocessors: { './src/test.ts': ['angular-cli'] }, remapIstanbulReporter: { reports: { html: 'coverage', lcovonly: './coverage/coverage.lcov' } }, angularCliConfig: './angular-cli.json', angularCli: { config: './angular-cli.json', environment: 'dev' }, reporters: ['progress', 'karma-remap-istanbul'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], singleRun: false }); };
please any work-around, i am desperate here.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
Running
ng test
on Windows, with admin permissions, on a newly generated project fails with aError: EMFILE: too many open files
error.Running
ng serve
andng test --build=false
in separate works though./cc @wardbell
OS: Windows 10
Reproduction steps:
Result: