Skip to content

Instantly share code, notes, and snippets.

@hulbert
Last active May 13, 2016 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hulbert/7839b37035906b562c7f48f03af3de64 to your computer and use it in GitHub Desktop.
Save hulbert/7839b37035906b562c7f48f03af3de64 to your computer and use it in GitHub Desktop.
mixed done and promise in lab leads to confusing warning
{
"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"
}
}
'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