Skip to content
This repository has been archived by the owner on Feb 2, 2020. It is now read-only.

Commit

Permalink
Merge f5b9265 into ddc66ac
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Jun 24, 2016
2 parents ddc66ac + f5b9265 commit 1d19cf3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ node_js:
- "0.11"
- "iojs"

branches:
only:
- master

cache:
directories:
- node_modules

script:
- mocha --version
- eslint --version
- npm run cover

after_script:
Expand Down
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ platform:
- x86
- x64

branches:
only:
- master

# Fix line endings in Windows. (runs before repo cloning)
init:
- git config --global core.autocrlf true
Expand All @@ -25,6 +29,8 @@ install:
test_script:
- node --version
- npm --version
- mocha --version
- eslint --version
- npm test

# http://help.appveyor.com/discussions/questions/1310-delete-cache
Expand Down
2 changes: 1 addition & 1 deletion lib/mocha/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ export default (lintTestFile, options) => {
addCompilers(mochaCompilers, extensions);
addFiles(mocha, mochaFiles, extensions, isMochaRecursive, lintTestFile);

mocha.run();
mocha.run(process.exit);
};
2 changes: 1 addition & 1 deletion test/acceptance/failure-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('acceptance - failure', function() {
'--eslint-args="**/*.js"',
'--mocha-args="test/**/*-test.js"'
];
return run(args, workingDir).then(stdout => {
return run(args, workingDir).catch(stdout => {
expect(stdout).to.contain(`${ok} this is my test`);
expect(stdout).to.contain('my-file.js passes');
expect(stdout).to.contain('my-test.js passes');
Expand Down
7 changes: 6 additions & 1 deletion test/helpers/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ export default (args, workingDir) => {
process.chdir(originalWorkingDir);
}

if (stderr) {
let hasRuntimeError = stderr;
let hasTestError = err;

if (hasRuntimeError) {
reject(stderr);
} else if (hasTestError) {
reject(stdout);
} else {
resolve(stdout);
}
Expand Down
3 changes: 2 additions & 1 deletion test/unit/mocha/run-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ describe('unit - mocha/run', function() {
it('runs mocha', function() {
run(null, {});

expect(mochaRun.args).to.deep.equal([[]]);
expect(mochaRun.args.length).to.equal(1);
expect(mochaRun.args[0].length).to.equal(1);
});
});

0 comments on commit 1d19cf3

Please sign in to comment.