hapijs/lab 中非常基本的测试失败:
'use strict';
const Code = require('code');
const expect = Code.expect;
const Lab = require('lab');
const lab = exports.lab = Lab.script();
lab.experiment('math', () => {
lab.test('returns true when 1 + 1 equals 2', () => {
expect(1 + 1).to.equal(2);
});
});
与此消息:
1) math returns true when 1 + 1 equals 2:
Function for "math returns true when 1 + 1 equals 2" should either take a callback argument or return a promise
at Immediate.setImmediate [as _onImmediate] (/home/ubuntu/projects/service/node_modules/lab/lib/runner.js:755:20)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
at processImmediate [as _immediateCallback] (timers.js:745:5)
1 of 1 tests failed
Test duration: 29 ms
Assertions count: 0 (verbosity: 0.00)
该测试直接来自实验室文档。知道出了什么问题吗?