-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing integration tests to scripts
- Loading branch information
Showing
6 changed files
with
113 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
var helpers = require('../helpers'); | ||
var invokeMocha = helpers.invokeMocha; | ||
var escapeRegExp = helpers.escapeRegExp; | ||
var interfaces = require('../../../lib/mocha').interfaces; | ||
|
||
describe('--interfaces', function() { | ||
it('should dump a list of all interfaces with descriptions', function(done) { | ||
var expected = Object.keys(interfaces) | ||
.filter(function(name) { | ||
return /^[a-z]/.test(name); | ||
}) | ||
.map(function(name) { | ||
return { | ||
name: escapeRegExp(name), | ||
description: escapeRegExp(interfaces[name].description) | ||
}; | ||
}); | ||
|
||
invokeMocha(['--interfaces'], function(err, result) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
expect(result.code, 'to be', 0); | ||
expected.forEach(function(ui) { | ||
expect( | ||
result.output, | ||
'to match', | ||
new RegExp(ui.name + '\\s*-\\s*' + ui.description) | ||
); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
var runMocha = require('../helpers').runMocha; | ||
|
||
describe('--reporter-option', function() { | ||
describe('when given options w/ invalid format', function() { | ||
it('should display an error', function(done) { | ||
runMocha( | ||
'passing.fixture.js', | ||
['--reporter-option', 'foo=bar=baz'], | ||
function(err, res) { | ||
if (err) { | ||
return done(err); | ||
} | ||
expect(res, 'to have failed').and( | ||
'to contain output', | ||
/invalid reporter option/i | ||
); | ||
done(); | ||
}, | ||
'pipe' | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
var helpers = require('../helpers'); | ||
var invokeMocha = helpers.invokeMocha; | ||
var escapeRegExp = helpers.escapeRegExp; | ||
var reporters = require('../../../lib/mocha').reporters; | ||
|
||
describe('--reporters', function() { | ||
it('should dump a list of all reporters with descriptions', function(done) { | ||
var expected = Object.keys(reporters) | ||
.filter(function(name) { | ||
return ( | ||
/^[a-z]/.test(name) && | ||
!(reporters[name].abstract || reporters[name].browserOnly) | ||
); | ||
}) | ||
.map(function(name) { | ||
return { | ||
name: escapeRegExp(name), | ||
description: escapeRegExp(reporters[name].description) | ||
}; | ||
}); | ||
|
||
invokeMocha(['--reporters'], function(err, result) { | ||
if (err) { | ||
return done(err); | ||
} | ||
|
||
expect(result.code, 'to be', 0); | ||
expected.forEach(function(reporter) { | ||
expect( | ||
result.output, | ||
'to match', | ||
new RegExp(reporter.name + '\\s*-\\s*' + reporter.description) | ||
); | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.