This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a bit hacky error to throw instead of full powered AssertionError
- Loading branch information
Showing
2 changed files
with
61 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var should = require('../'); | ||
var err = require('./util').err; | ||
|
||
|
||
var a = 10; | ||
var b = 11; | ||
|
||
describe('.not', function() { | ||
it('should not throw when true', function() { | ||
a.should.be.exactly(a); | ||
}); | ||
|
||
it('should throw when false', function() { | ||
err(function() { | ||
a.should.be.exactly(b); | ||
}, 'expected 10 to be 11'); | ||
}); | ||
|
||
it('should throw when not true (false negative case)', function() { | ||
err(function() { | ||
a.should.not.be.exactly(a); | ||
}, 'expected 10 not to be 10 (false negative fail)'); | ||
}); | ||
|
||
it('should not throw when not false', function() { | ||
a.should.not.be.exactly(b); | ||
}); | ||
}); |