我正在使用deepEqual
断言,但我的测试失败
测试
test('should return list of printers', t => {
const clipboard = filter.asClipboardContent(scan);
t.is(clipboard, [
{hostname: '10.0.1.1', port: '9100', description: 'HP 5020-NL'},
{hostname: '10.0.1.8', port: '9100', description: 'Brother 4002'}
]);
}
失败输出
t.deepEqual(clipboard, [{ hostname: '10.0.1.1', port: '9100', description: 'HP 5020-NL' }, { hostname: '10.0.1.8', port: '9100', description: 'Brother 4002' }])
|
[Object{hostname:"10.0.1.1",port:9100,description:"HP 5020-NL"},Object{hostname:"10.0.1.8",port:9100,description:"Brother 4002"}]
问题
我该如何解决?