-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve output for errors thrown, create examples
- Loading branch information
Showing
9 changed files
with
89 additions
and
26 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,11 @@ | ||
|
||
var test = require('tap').test; | ||
|
||
test('failing example which writes to stderr', function (t) { | ||
t.equal('foo', 'bar', 'purposefully making this fail for example'); | ||
console.error('I will log to stderr here.'); | ||
t.end(); | ||
}); | ||
|
||
|
||
|
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,16 @@ | ||
|
||
var test = require('tap').test; | ||
|
||
test('failing example which writes to stdout', function (t) { | ||
t.equal('cat', 'dog', 'purposefully making this fail for example'); | ||
console.error('I will log to stdout here.'); | ||
t.end(); | ||
}); | ||
|
||
test('successful example', function (t) { | ||
t.equal(1, 1); | ||
t.end(); | ||
}); | ||
|
||
|
||
|
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,13 @@ | ||
|
||
var test = require('tap').test; | ||
|
||
var obj = { }; | ||
|
||
test('failing example which throws', function (t) { | ||
obj.boom(); //throws TypeError since boom is not a method of obj | ||
t.ok(true); | ||
t.end(); | ||
}); | ||
|
||
|
||
|
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,15 @@ | ||
|
||
var test = require('tap').test; | ||
|
||
test('successful example with stderr', function (t) { | ||
//This stderr output will not display in the tapr output unless this | ||
//file has at least one failing test. Makes it easy to ignore output | ||
//except when you care about it. | ||
console.error('this will not display unless a failure occurs in page'); | ||
t.equal(1, 1); | ||
t.end(); | ||
}); | ||
|
||
|
||
|
||
|
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