Created
September 11, 2020 23:50
-
-
Save hideack/ade1d3ddae7e59653e17ce69aa71db8d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // test/foo.test.js | |
| var should = require('should'); | |
| function Foo() { | |
| return { | |
| hoge: function(val) { | |
| if (val == '') { | |
| throw new Error('fail'); | |
| } | |
| return val; | |
| } | |
| }; | |
| } | |
| var foo = Foo(); | |
| describe('Foo', function() { | |
| describe('#sample1', function() { | |
| it('equal test', function(){ | |
| foo.hoge('bar').should.equal('bar'); | |
| }); | |
| }); | |
| describe('#sample2', function() { | |
| it('exception test', function(){ | |
| (function(){ foo.hoge('') }).should.throw(); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment