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

Make TAP reporter TAP13-capable #3552

Merged
merged 84 commits into from
Nov 10, 2018
Merged
Changes from 1 commit
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
d3c2df9
added test to make sure first line of report is version line
mollstam Aug 8, 2018
c067a6e
reporter will now print version line as first line
mollstam Aug 8, 2018
9c78b61
Changed test to look for plan (1..N) on second line.
mollstam Aug 8, 2018
78ab6c5
Added integration tests to make sure we conform to spec.
mollstam Aug 8, 2018
b59af19
Extended integration test to validate plan, test is growing...
mollstam Aug 8, 2018
ddc5b17
removed some section comments and minor restructure
mollstam Aug 8, 2018
f030a4b
broke out testLineMatcher to testLinePredicate with minor refactor.
mollstam Aug 8, 2018
43c94c8
added a bunch of predicates to identify lines
mollstam Aug 8, 2018
8d369b7
stacks and errors are now wrapped inside YAML blocks
mollstam Aug 8, 2018
9677744
changed arrow function to ye olde function to appease bots
mollstam Aug 8, 2018
3047441
found linter and made code conform, `npm run test` now clean.
mollstam Aug 8, 2018
253d76a
added reporters.fixture.js for testing reporter capabilities
mollstam Aug 9, 2018
e00b99c
Fixed error message potentially breaking YAML block, some cleanup.
mollstam Aug 9, 2018
1e559b3
TAP now inherits from Base
mollstam Aug 9, 2018
419fc33
TAP no longer inherits from Base, decided not to use any Base functio…
mollstam Aug 9, 2018
3551db3
TAP unit tests now expect message starting with literal
mollstam Aug 9, 2018
68d8b9c
TAP integration tests use reporters fixture instead of uncaught
mollstam Aug 9, 2018
3b5f88f
refactored yaml indentation to clean things up
mollstam Sep 19, 2018
3cac7f1
fix to refactored indent which added an extra space on some lines
mollstam Sep 19, 2018
b5b88a1
Retrigger appveyor test
mollstam Sep 19, 2018
ce24d96
TAP reporter inherits Base
mollstam Sep 20, 2018
d5b519d
TAP reporter uses runner.stats rather than internal tracking
mollstam Sep 20, 2018
3242408
added support for `spec` reporterOption and started implementing `TAP…
mollstam Sep 20, 2018
61e8c79
TAP13 tests now run with proper spec selected
mollstam Sep 20, 2018
8dc5b65
extracted fail reporting to producers
mollstam Sep 20, 2018
4b11a31
added missing tests to TAP12 spec which are identical to TAP13 expect…
mollstam Sep 20, 2018
38b8ce3
extracted pending reporting to producers
mollstam Sep 20, 2018
7951bf0
extracted pass reporting to producers
mollstam Sep 20, 2018
ff80cf4
extracted end reporting to producers and refactored to common base
mollstam Sep 20, 2018
0496ef3
fixed bad redeclare
mollstam Sep 20, 2018
42035e7
fix to integrations tests to use TAP13 spec
mollstam Sep 20, 2018
4d9188f
Merge branch 'reporter-tap-v13' of https://github.com/mollstam/mocha …
plroebuck Nov 4, 2018
03e3440
feat(reporters/tap.js): Make TAP reporter conform to TAP13
plroebuck Nov 4, 2018
b060a14
test(reporters.spec.js,tap.spec.js): Updated to match `tapVersion` re…
plroebuck Nov 4, 2018
76a74bd
added test to make sure first line of report is version line
mollstam Aug 8, 2018
7e72ff9
reporter will now print version line as first line
mollstam Aug 8, 2018
ce0eecd
Changed test to look for plan (1..N) on second line.
mollstam Aug 8, 2018
9352709
Added integration tests to make sure we conform to spec.
mollstam Aug 8, 2018
f027dc5
Extended integration test to validate plan, test is growing...
mollstam Aug 8, 2018
5d88454
removed some section comments and minor restructure
mollstam Aug 8, 2018
425b03f
broke out testLineMatcher to testLinePredicate with minor refactor.
mollstam Aug 8, 2018
2af2e84
added a bunch of predicates to identify lines
mollstam Aug 8, 2018
f6cf3cf
stacks and errors are now wrapped inside YAML blocks
mollstam Aug 8, 2018
308b381
changed arrow function to ye olde function to appease bots
mollstam Aug 8, 2018
009daed
found linter and made code conform, `npm run test` now clean.
mollstam Aug 8, 2018
ccbd91e
added reporters.fixture.js for testing reporter capabilities
mollstam Aug 9, 2018
b2746b3
Fixed error message potentially breaking YAML block, some cleanup.
mollstam Aug 9, 2018
9cb8990
TAP now inherits from Base
mollstam Aug 9, 2018
54ca9f7
TAP no longer inherits from Base, decided not to use any Base functio…
mollstam Aug 9, 2018
56752f1
TAP unit tests now expect message starting with literal
mollstam Aug 9, 2018
4680170
TAP integration tests use reporters fixture instead of uncaught
mollstam Aug 9, 2018
e75408d
refactored yaml indentation to clean things up
mollstam Sep 19, 2018
ab0db06
fix to refactored indent which added an extra space on some lines
mollstam Sep 19, 2018
f00ca30
TAP reporter inherits Base
mollstam Sep 20, 2018
ae782b8
TAP reporter uses runner.stats rather than internal tracking
mollstam Sep 20, 2018
9e2e5bf
added support for `spec` reporterOption and started implementing `TAP…
mollstam Sep 20, 2018
1b06541
TAP13 tests now run with proper spec selected
mollstam Sep 20, 2018
709f567
extracted fail reporting to producers
mollstam Sep 20, 2018
c646564
added missing tests to TAP12 spec which are identical to TAP13 expect…
mollstam Sep 20, 2018
4442207
extracted pending reporting to producers
mollstam Sep 20, 2018
f4590ee
extracted pass reporting to producers
mollstam Sep 20, 2018
552091b
extracted end reporting to producers and refactored to common base
mollstam Sep 20, 2018
dd1ebc1
fixed bad redeclare
mollstam Sep 20, 2018
cb0258d
fix to integrations tests to use TAP13 spec
mollstam Sep 20, 2018
f472b6b
3483: Squelch CI Growl-related spawn errors (#3517)
plroebuck Oct 24, 2018
207ed8c
test(test/reporters/base.spec.js): Fix Base reporter test failure due…
plroebuck Oct 20, 2018
02d75ee
Update "commander" to correct display of falsy default values (#3529)
outsideris Oct 27, 2018
ff6cbe7
refactor(bin/options.js): Refactor and improve documentation (#3533)
plroebuck Oct 30, 2018
2f28b49
refactor(json-stream.js): Consistent output stream usage (#3532)
plroebuck Oct 30, 2018
2d89a47
fix(_mocha): Update '--no-timeouts' argument description (#3546)
plroebuck Nov 2, 2018
f2f79c0
build(ESLint/Git): Ignore JSDoc output directory (#3544)
plroebuck Nov 2, 2018
ee4625f
ci(Travis/Appveyor): Update Node versions in CI matrix (#3543)
plroebuck Nov 2, 2018
cebb18a
update release instructions [ci skip]
boneskull Nov 2, 2018
9286fdc
fix runner to emit start/end event (#3395)
outsideris Nov 2, 2018
d4808a3
Warn that suites cannot return a value (#3550)
plroebuck Nov 4, 2018
c6c784a
feat(reporters/tap.js): Make TAP reporter conform to TAP13
plroebuck Nov 4, 2018
c179a34
test(reporters.spec.js,tap.spec.js): Updated to match `tapVersion` re…
plroebuck Nov 4, 2018
df03a00
test(reporters/helpers.js): Add update to "helpers.js" from PR #3528
plroebuck Nov 6, 2018
6d32ec9
test(reporters/tap.spec.js): Update TAP reporter test before merge
plroebuck Nov 6, 2018
3b01085
Merge branch 'mollstam-reporter-tap-v13' of https://github.com/mochaj…
plroebuck Nov 6, 2018
9d8b18a
test(reporters.tap.spec.js): Remove unused variable
plroebuck Nov 6, 2018
b3ea5ed
Merge branch 'master' into mollstam-reporter-tap-v13
plroebuck Nov 6, 2018
0ce70f8
docs(reporters/tap.js): Updated JSDoc
plroebuck Nov 10, 2018
e5b516e
Merge branch 'mollstam-reporter-tap-v13' of https://github.com/mochaj…
plroebuck Nov 10, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Extended integration test to validate plan, test is growing...
  • Loading branch information
mollstam authored and plroebuck committed Nov 5, 2018
commit f027dc52d8446a89726506594e323eb8ad30d398
55 changes: 49 additions & 6 deletions test/integration/reporters.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('reporters', function() {

describe('tap', function() {
describe('produces valid TAP v13 output', function() {
var runFixtureAndValidateOutput = function(fixture) {
var runFixtureAndValidateOutput = function(fixture, expected) {
it('for ' + fixture, function(done) {
var args = ['--reporter=tap'];
run(fixture, args, function(err, res) {
Expand All @@ -111,18 +111,61 @@ describe('reporters', function() {
return;
}

var outputLines = res.output.split('\n');

// see https://testanything.org/tap-version-13-specification.html

// first line must be `TAP version 13`
var firstLine = res.output.split('\n', 1)[0];
expect(firstLine, 'to equal', 'TAP version 13');
// Version
var expectedVersion = 13;
// first line must be version line
expect(
outputLines[0],
'to equal',
'TAP version ' + expectedVersion
);

// Plan
var expectedPlan = '1..' + expected.numTests;
// plan must appear once
expect(outputLines, 'to contain', expectedPlan);
expect(
outputLines.filter(l => l === expectedPlan),
'to have length',
1
);
// plan cannot appear in middle of the output
var testLineMatcher = function(line) {
return line.match(/^not ok/) || line.match(/^ok/);
};
var firstTestLine = outputLines.findIndex(testLineMatcher);
expect(firstTestLine, 'to be greater than', -1);
var lastTestLine =
outputLines.length -
1 -
outputLines
.slice()
.reverse()
.findIndex(testLineMatcher);
var planLine = outputLines.findIndex(function(line) {
return line === expectedPlan;
});
expect(
planLine < firstTestLine || planLine > lastTestLine,
'to equal',
true
);

done();
});
});
};

runFixtureAndValidateOutput('passing.fixture.js');
runFixtureAndValidateOutput('uncaught.fixture.js');
runFixtureAndValidateOutput('passing.fixture.js', {
numTests: 2
});
runFixtureAndValidateOutput('uncaught.fixture.js', {
numTests: 2
});
});
});
});