Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed tests running two times for npm run test #336

Merged
merged 1 commit into from
Aug 24, 2015
Merged

Fixed tests running two times for npm run test #336

merged 1 commit into from
Aug 24, 2015

Conversation

SwinX
Copy link
Contributor

@SwinX SwinX commented Aug 24, 2015

resolves #334

@SwinX SwinX added the test label Aug 24, 2015
@SwinX SwinX self-assigned this Aug 24, 2015
@SwinX SwinX added the review label Aug 24, 2015
@SwinX
Copy link
Contributor Author

SwinX commented Aug 24, 2015

/cc @blond @j0tunn

"build-sample-proj": "node ./bin/enb make -n --graph --dir test/fixtures/sample-project",
"check-style": "jscs -c node_modules/enb-validate-code/jscs.json lib exlib techs test",
"coverage": "istanbul cover _mocha",
"coverage": "istanbul cover _mocha --recursive test/lib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы тут оставил -R dot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему-то вылетает с подобной ошибкой:

Error: cannot resolve path (or pattern) 'dot' at Object.lookupFiles (/Users/matumbaman/Documents/enb/node_modules/mocha/lib/utils.js:494:32) at runAgain (/Users/matumbaman/Documents/enb/node_modules/mocha/bin/_mocha:316:30) at Array.forEach (native) at Object.<anonymous> (/Users/matumbaman/Documents/enb/node_modules/mocha/bin/_mocha:315:6) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Object.Module._extensions.(anonymous function) [as .js] (/Users/matumbaman/Documents/enb/node_modules/istanbul/lib/hook.js:109:37) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) ...

@SwinX
Copy link
Contributor Author

SwinX commented Aug 24, 2015

Почему-то после этого изменения coverage подскочил до 86%. Кажется, что где-то ошибка.

@SwinX
Copy link
Contributor Author

SwinX commented Aug 24, 2015

А это точно теперь будет работать?
Вроде бы, вместо npm run coverage -- теперь надо stanbul cover _mocha --recursive test/lib.

Прочитал скрипт ещё раз - а почему не должно сработать?

@SwinX
Copy link
Contributor Author

SwinX commented Aug 24, 2015

Поменял --recursive на **, в теории coverage должен начать считаться правильно. Почему не работает --recursive по прежнему не ясно.

@@ -87,11 +87,11 @@
"scripts": {
"test": "npm run jshint && npm run check-style && npm run func-test && npm run unit-test",
"jshint": "jshint .",
"unit-test": "mocha -u bdd -R spec --recursive test/lib",
"func-test": "npm run build-sample-proj && mocha -u bdd -R spec --recursive test/func",
"unit-test": "mocha --recursive test/lib",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тут все тесты запускаются?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да, все, там была особенность передачи опций в istanbul

@SwinX
Copy link
Contributor Author

SwinX commented Aug 24, 2015

Переписал скрипты с учётом того, что разобрались, для чего нужна опция --. В теории теперь всё должно быть правильно

@j0tunn
Copy link
Contributor

j0tunn commented Aug 24, 2015

🆗

blond added a commit that referenced this pull request Aug 24, 2015
Fixed tests running two times for npm run test
@blond blond merged commit 4db5474 into master Aug 24, 2015
@blond blond deleted the issue-334 branch August 24, 2015 15:48
@blond blond removed the review label Aug 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

For npm test command all tests are running two times
3 participants