-
-
Save hulbert/7839b37035906b562c7f48f03af3de64 to your computer and use it in GitHub Desktop.
mixed done and promise in lab leads to confusing warning
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
{ | |
"name": "some-lab-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "lab --verbose --debug" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"devDependencies": { | |
"lab": "10.5.1" | |
} | |
} |
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
'use strict' | |
const Lab = require('lab'); | |
const lab = exports.lab = Lab.script(); | |
const describe = lab.describe; | |
const it = lab.it; | |
describe('my test suite', function() { | |
/* | |
This gives the following error at the end of the test suite: | |
Test script errors: | |
Multiple callbacks or thrown errors received in test "my test suite should give me a better warning" (undefined) | |
*/ | |
it('should give me a better warning', function(done) { | |
return new Promise(function(resolve) { | |
setTimeout(function() { | |
resolve('we are done here') | |
}, 1000) | |
}) | |
.then(function() { | |
done() | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment