Last active
March 11, 2016 03:58
-
-
Save colwem/84d04c2f9ccbca8626c8 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
| 'use strict'; | |
| const expect = require('chai').expect; | |
| describe('foo', () => { | |
| it('should finish', (done) => { | |
| Promise | |
| .reject(new Error()) | |
| .catch(() => expect(false).to.be.true) | |
| .then(() => done(), done); | |
| }); | |
| it("should finish but won't", (done) => { | |
| Promise.resolve(true) | |
| .then(() => {expect(false).to.be.true; done()}, done); | |
| }); | |
| it("should be rejected but isn't", (done) => { | |
| Promise.resolve(true) | |
| .then(() => {expect(false).to.be.true; done()}) | |
| .catch(() => done()); | |
| }); | |
| it("Wooooo this works", (done) => { | |
| Promise.resolve(true) | |
| .then(() => {expect(false).to.be.true; done()}) | |
| .catch(done); | |
| }); | |
| }); |
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
| foo | |
| 1) should finish | |
| 2) should finish but won't | |
| ✓ should be rejected but isn't | |
| 3) Wooooo this works | |
| 1 passing (2s) | |
| 3 failing | |
| 1) foo should finish: | |
| AssertionError: expected false to be true | |
| at /Users/colwem/workshop/autocron/test/temp.test.js:9:36 | |
| at runMicrotasksCallback (node.js:337:7) | |
| at doNTCallback0 (node.js:430:9) | |
| at process._tickCallback (node.js:359:13) | |
| 2) foo should finish but won't: | |
| Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. | |
| at null.<anonymous> (/usr/local/lib/node_modules/mocha/lib/runnable.js:170:19) | |
| at Timer.listOnTimeout (timers.js:92:15) | |
| 3) foo Wooooo this works: | |
| AssertionError: expected false to be true | |
| at /Users/colwem/workshop/autocron/test/temp.test.js:26:36 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment