karma-runner / karma-runner/karma

Exits with status code 1 and does not run tests

Open
#2,528 9 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Expected behaviour
Tests should run as expected and open the browser window.

### Actual behaviour
```
➜ NeXgen-RulesEngine git:(master) npm run test

> form-rules@1.0.0 test /Users/brentoneill/Desktop/NeXgen-RulesEngine
> karma start karma.config.js --no-auto-watch

ts-loader: Using typescript@1.8.10 and /Users/brentoneill/Desktop/NeXgen-RulesEngine/tsconfig.json
06 01 2017 11:10:47.012:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
06 01 2017 11:10:47.022:INFO [launcher]: Starting browser Chrome
06 01 2017 11:10:47.814:INFO [Chrome 55.0.2883 (Mac OS X 10.11.6)]: Connected on socket /#bQUigWQLHMsCwypEAAAA with id 33535306
Chrome 55.0.2883 (Mac OS X 10.11.6): Executed 0 of 0 ERROR (0.003 secs / 0 secs)

npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/node" "/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/npm" "run" "test"
npm ERR! node v5.12.0
npm ERR! npm v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! form-rules@1.0.0 test: `karma start karma.config.js --no-auto-watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the form-rules@1.0.0 test script 'karma start karma.config.js --no-auto-watch'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the form-rules package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! karma start karma.config.js --no-auto-watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs form-rules
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls form-rules
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/brentoneill/Desktop/NeXgen-RulesEngine/npm-debug.log```
```
### Environment Details

- Karma version - **1.3.0**
Config:
```
...
// web server port
port: 9876,

// enable / disable colors in the output (reporters and logs)
colors: true,

client: {
captureConsole: false
},

// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,

// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true,

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],

// If browser does not capture in given timeout [ms], kill it
captureTimeout: 60000,

plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-html-reporter',
require('karma-webpack')
],

reporters: ['progress', 'html'],

// the default configuration
htmlReporter: {
outputDir: 'karma_html', // where to put the reports
templatePath: null, // set if you moved jasmine_template.html
focusOnFailures: true, // reports show failures on start
namedFiles: false, // name files instead of creating sub-directories
pageTitle: null, // page title for reports; browser info by default
urlFriendlyName: false, // simply replaces spaces with _ for files/dirs
reportName: 'report-summary-filename', // report summary filename; browser info by default

// experimental
preserveDescribeNesting: false, // folded suites stay folded
foldAll: false, // reports start folded (only with preserveDescribeNesting)
},
```

### Steps to reproduce the behaviour

1. Run the test command `npm run test`
2.Karma looks like its starting then it shows that it executes 0 of 0 tests when we have 133 in this repo.

### npm debug log
```
0 info it worked if it ends with ok
1 verbose cli [ '/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/node',
1 verbose cli '/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test' ]
2 info using npm@3.8.6
3 info using node@v5.12.0
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle form-rules@1.0.0~pretest: form-rules@1.0.0
6 silly lifecycle form-rules@1.0.0~pretest: no script for pretest, continuing
7 info lifecycle form-rules@1.0.0~test: form-rules@1.0.0
8 verbose lifecycle form-rules@1.0.0~test: unsafe-perm in lifecycle true
9 verbose lifecycle form-rules@1.0.0~test: PATH: /Users/brentoneill/.nvm/versions/node/v5.12.0/lib/node_modules/npm/bin/node-gyp-bin:/Users/brentoneill/Desktop/NeXgen-RulesEngine/node_modules/.bin:/Users/brentoneill/.nvm/versions/node/v5.12.0/bin:/Users/brentoneill/.nvm/versions/node/v5.12.0/bin:/Users/brentoneill/.rvm/gems/ruby-2.1.0/bin:/Users/brentoneill/.rvm/gems/ruby-2.1.0@global/bin:/Users/brentoneill/.rvm/rubies/ruby-2.1.0/bin:/usr/local/heroku/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/brentoneill/apache-maven-3.3.9/bin:/Users/brentoneill/.rvm/bin
10 verbose lifecycle form-rules@1.0.0~test: CWD: /Users/brentoneill/Desktop/NeXgen-RulesEngine
11 silly lifecycle form-rules@1.0.0~test: Args: [ '-c', 'karma start karma.config.js --no-auto-watch' ]
12 silly lifecycle form-rules@1.0.0~test: Returned: code: 1 signal: null
13 info lifecycle form-rules@1.0.0~test: Failed to exec test script
14 verbose stack Error: form-rules@1.0.0 test: `karma start karma.config.js --no-auto-watch`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/Users/brentoneill/.nvm/versions/node/v5.12.0/lib/node_modules/npm/lib/utils/lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at EventEmitter.emit (events.js:185:7)
14 verbose stack at ChildProcess. (/Users/brentoneill/.nvm/versions/node/v5.12.0/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:100:13)
14 verbose stack at ChildProcess.emit (events.js:185:7)
14 verbose stack at maybeClose (internal/child_process.js:850:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid form-rules@1.0.0
16 verbose cwd /Users/brentoneill/Desktop/NeXgen-RulesEngine
17 error Darwin 15.6.0
18 error argv "/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/node" "/Users/brentoneill/.nvm/versions/node/v5.12.0/bin/npm" "run" "test"
19 error node v5.12.0
20 error npm v3.8.6
21 error code ELIFECYCLE
22 error form-rules@1.0.0 test: `karma start karma.config.js --no-auto-watch`
22 error Exit status 1
23 error Failed at the form-rules@1.0.0 test script 'karma start karma.config.js --no-auto-watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the form-rules package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error karma start karma.config.js --no-auto-watch
23 error You can get information on how to open an issue for this project with:
23 error npm bugs form-rules
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls form-rules
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
```

Contributor guide

Open the contributing guide

Research direction

Start by running npm run test and inspect karma.config.js, including the browser, plugin, and test-loading configuration shown in the report. Determine why Karma executes 0 tests, then verify that the repository's tests run and the command completes successfully instead of exiting with status 1.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript, webpack
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.