-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Update to latest version of tap and tap-parser #314
Closed
Closed
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7db3bdc
update test/array.js to use concat-stream instead of tap.createConsum…
nelsonic 0e04ba7
remove redundant .map that checks typeof r === 'object' ... rows are …
nelsonic c319f83
update test/default-messages.js to match output of latest version of …
nelsonic fae3c51
add getStackTrace method to extract the error message from tap output…
nelsonic f944fbb
update test/end-as-callback.js using concat-stream instead of tap.cre…
nelsonic c33c0bf
update test/exit.js to use concat-stream instead of tap.createConsume…
nelsonic c68c34c
update test/fail.js to use concat-stream instead of tap.createConsume…
nelsonic 370b6fb
update test/nested-sync-noplan-noend.js to use concat-stream instead …
nelsonic cf6fcb4
update test/nested.js to use concat-stream instead of tap.createConsu…
nelsonic 8afdd1e
update test/require.js to use concat-stream instead of tap.createCons…
nelsonic a0f7d73
update test/only.js to use concat-stream instead of tap.createConsume…
nelsonic 453bd55
update test/timeoutAfter.js to use concat-stream instead of tap.creat…
nelsonic 771e411
update test/too_many.js to use concat-stream instead of tap.createCon…
nelsonic 6633e9a
temporarily comment out 3 tests in test/skip.js makes the other tests…
nelsonic 27ce042
remove redundant tests from test/skip.js - still testing the document…
nelsonic 4b52e9a
remove redundant tests in test/throws.js (assertion unchanged! Passes…
nelsonic ceec1f1
tidy up before requesting pull request code review.
nelsonic 3bdd82f
update tests to match format in test/skip.js (consistency) see: https…
nelsonic ce0b410
split the tap output array before comparing in test/require.js to kee…
nelsonic 82ba4d4
update all instances of spawn to use path.join for windows compatabil…
nelsonic c4025c1
update tests to reflect double-blank-lines in Tap output as discussed…
nelsonic e721508
tidy up test/default-messages.js as discussed in https://github.com/s…
nelsonic d93d3e3
tidy up tests containing spawn discussed in https://github.com/substa…
nelsonic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -1,37 +1,31 @@ | ||
var tap = require('tap'); | ||
var spawn = require('child_process').spawn; | ||
var trim = require('string.prototype.trim'); | ||
var concat = require('concat-stream'); | ||
|
||
tap.test('default messages', function (t) { | ||
t.plan(1); | ||
|
||
var tc = tap.createConsumer(); | ||
var ps = spawn(process.execPath, | ||
[ require('path').join(__dirname, 'messages', 'defaults.js') ]); | ||
|
||
var rows = []; | ||
tc.on('data', function (r) { rows.push(r) }); | ||
tc.on('end', function () { | ||
var rs = rows.map(function (r) { | ||
if (r && typeof r === 'object') { | ||
return { id : r.id, ok : r.ok, name : trim(r.name) }; | ||
} | ||
else return r; | ||
}); | ||
t.same(rs, [ | ||
'TAP version 13', | ||
'default messages', | ||
{ id: 1, ok: true, name: 'should be truthy' }, | ||
{ id: 2, ok: true, name: 'should be falsy' }, | ||
{ id: 3, ok: true, name: 'should be equal' }, | ||
{ id: 4, ok: true, name: 'should not be equal' }, | ||
{ id: 5, ok: true, name: 'should be equivalent' }, | ||
{ id: 6, ok: true, name: 'should be equivalent' }, | ||
{ id: 7, ok: true, name: 'should be equivalent' }, | ||
'tests 7', | ||
'pass 7', | ||
'ok' | ||
]); | ||
}); | ||
ps.stdout.pipe(concat(function (rows) { | ||
|
||
var ps = spawn(process.execPath, [ __dirname + '/messages/defaults.js' ]); | ||
ps.stdout.pipe(tc); | ||
t.same(rows.toString('utf8'), [ | ||
'TAP version 13', | ||
'# default messages', | ||
'ok 1 should be truthy', | ||
'ok 2 should be falsy', | ||
'ok 3 should be equal', | ||
'ok 4 should not be equal', | ||
'ok 5 should be equivalent', | ||
'ok 6 should be equivalent', | ||
'ok 7 should be equivalent', | ||
'', | ||
'1..7', | ||
'# tests 7', | ||
'# pass 7', | ||
'', | ||
'# ok' | ||
].join('\n') + '\n\n'); | ||
})); | ||
}); |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'd prefer this indentation to be such that if the entire invocation doesn't fit on one line, each argument goes on a line by itself, as does the closing invocation paren.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ljharb like this:
There does not appear to be a line-length rule/guideline in the project.
in-lining the the code is 96 characters is that acceptable?
(I'm used to aiming for max 80 chars per line...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first example is exactly what I had in mind.
Personally I find "max line length" restrictions silly. If your first example is too long for you, you could do:
(in either case, please move the require to a variable at the top level)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
Went with the single line with the `require('path') moved above its only 89 chars which I think is acceptable: