本文整理汇总了TypeScript中chai.assert.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isEmpty方法的具体用法?TypeScript assert.isEmpty怎么用?TypeScript assert.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
dvb.pins(0, 0, 0, 0).then((data) => {
assert.isArray(data);
assert.isEmpty(data);
}));
示例2: it
it('chain block', function () {
TestFunctionRunner.clearLog();
let job = new Job();
let aBlock = job.createBlock('a');
let bBlock = job.createBlock('b');
let cBlock = job.createBlock('c');
aBlock._load({
'#is': '',
'obj1': {'#is': '', 'v': 1},
'obj2': {'#is': '', 'v': 2},
'obj3': {'v': 3}
});
bBlock._load({
'#is': 'foreach',
'~input': '##.a',
'src': {
'#is': {
'#is': '',
'test': {'#is': 'test-runner', '~#-log': '##.#input.v'},
'add': {'#is': 'add', '~0': '##.#input.v', '1': 1},
'#output': {'#is': 'output', '~v': '##.add.output'}
}
}
});
cBlock._load({
'#is': 'foreach',
'~input': '##.b.output',
'src': {
'#is': {
'#is': '',
'multiply': {'#is': 'multiply', '~0': '##.#input.v', '1': 2},
'#output': {'#is': 'output', '~v': '##.multiply.output'}
}
}
});
Root.run();
assert.lengthOf(TestFunctionRunner.popLogs(), 3, 'worker run 3 times');
assert.equal(bBlock.queryValue('output.obj1.v'), 2, 'basic ForEach chain');
assert.equal(cBlock.queryValue('output.obj2.v'), 6, 'basic ForEach chain');
assert.equal(cBlock.queryValue('output.obj3.v'), 8, 'basic ForEach chain on child Object');
bBlock.updateValue('src', {
'#is': '',
'test': {'#is': 'test-runner', '~#-log': '##.#input.v'},
'subtract': {'#is': 'subtract', '~0': '##.#input.v', '1': 5},
'#output': {'#is': 'output', '~v': '##.subtract.output'}
});
Root.run();
assert.lengthOf(TestFunctionRunner.popLogs(), 3, 'worker run 3 times');
assert.equal(cBlock.queryValue('output.obj2.v'), -6, 'ForEach chain src changed');
assert.equal(cBlock.queryValue('output.obj3.v'), -4, 'ForEach chain src changed on child Object');
aBlock.deleteValue('obj2');
let obj4 = aBlock.createBlock('obj4');
obj4.setValue('v', 4);
aBlock.updateValue('obj5', {'v': 5});
Root.run();
assert.lengthOf(TestFunctionRunner.popLogs(), 2, 'worker run twice on 2 change items');
assert.isUndefined(cBlock.queryValue('output.obj2'), 'remove object');
assert.equal(cBlock.queryValue('output.obj4.v'), -2, 'add watch child');
assert.equal(cBlock.queryValue('output.obj5.v'), 0, 'add watch child Object');
job.updateValue('b', null);
aBlock.updateValue('obj6', {'v': 6});
Root.run();
assert.isUndefined(cBlock.queryValue('output'), 'output is removed when input is empty');
assert.isEmpty(TestFunctionRunner.logs, 'worker should not run after destroyed');
});