本文整理汇总了TypeScript中assert.strictEqual函数的典型用法代码示例。如果您正苦于以下问题:TypeScript strictEqual函数的具体用法?TypeScript strictEqual怎么用?TypeScript strictEqual使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了strictEqual函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return the messageheader ID and uri of the sent message', function () {
assert.strictEqual(response.messageheader[0].id, '1183C73D-2E62-4F60-B610-30F160BDFBD5');
assert.strictEqual(response.messageheader[0].uri, 'https://api.esendex.com/v1.0/messageheaders/1183C73D-2E62-4F60-B610-30F160BDFBD5');
});
示例2: test
test('template', () => {
// simple
assert.strictEqual(labels.template('Foo Bar'), 'Foo Bar');
assert.strictEqual(labels.template('Foo${}Bar'), 'FooBar');
assert.strictEqual(labels.template('$FooBar'), '');
assert.strictEqual(labels.template('}FooBar'), '}FooBar');
assert.strictEqual(labels.template('Foo ${one} Bar', { one: 'value' }), 'Foo value Bar');
assert.strictEqual(labels.template('Foo ${one} Bar ${two}', { one: 'value', two: 'other value' }), 'Foo value Bar other value');
// conditional separator
assert.strictEqual(labels.template('Foo${separator}Bar'), 'FooBar');
assert.strictEqual(labels.template('Foo${separator}Bar', { separator: { label: ' - ' } }), 'Foo - Bar');
assert.strictEqual(labels.template('${separator}Foo${separator}Bar', { value: 'something', separator: { label: ' - ' } }), 'Foo - Bar');
assert.strictEqual(labels.template('${value} Foo${separator}Bar', { value: 'something', separator: { label: ' - ' } }), 'something Foo - Bar');
// // real world example (macOS)
let t = '${activeEditorShort}${separator}${rootName}';
assert.strictEqual(labels.template(t, { activeEditorShort: '', rootName: '', separator: { label: ' - ' } }), '');
assert.strictEqual(labels.template(t, { activeEditorShort: '', rootName: 'root', separator: { label: ' - ' } }), 'root');
assert.strictEqual(labels.template(t, { activeEditorShort: 'markdown.txt', rootName: 'root', separator: { label: ' - ' } }), 'markdown.txt - root');
// // real world example (other)
t = '${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}';
assert.strictEqual(labels.template(t, { dirty: '', activeEditorShort: '', rootName: '', appName: '', separator: { label: ' - ' } }), '');
assert.strictEqual(labels.template(t, { dirty: '', activeEditorShort: '', rootName: '', appName: 'Visual Studio Code', separator: { label: ' - ' } }), 'Visual Studio Code');
assert.strictEqual(labels.template(t, { dirty: '', activeEditorShort: 'Untitled-1', rootName: '', appName: 'Visual Studio Code', separator: { label: ' - ' } }), 'Untitled-1 - Visual Studio Code');
assert.strictEqual(labels.template(t, { dirty: '', activeEditorShort: '', rootName: 'monaco', appName: 'Visual Studio Code', separator: { label: ' - ' } }), 'monaco - Visual Studio Code');
assert.strictEqual(labels.template(t, { dirty: '', activeEditorShort: 'somefile.txt', rootName: 'monaco', appName: 'Visual Studio Code', separator: { label: ' - ' } }), 'somefile.txt - monaco - Visual Studio Code');
assert.strictEqual(labels.template(t, { dirty: '* ', activeEditorShort: 'somefile.txt', rootName: 'monaco', appName: 'Visual Studio Code', separator: { label: ' - ' } }), '* somefile.txt - monaco - Visual Studio Code');
});
示例3: it
it('should respond with status code 409 Conflict', () => {
assert.strictEqual(statusCode, 409)
})
示例4: done
dummySocket.once('myservice testing', data => {
assert.strictEqual(data, 'hi');
done();
});
示例5:
volume.onSlice((sliceNum: number, data: Buffer) => {
assert.strictEqual(sliceNum, k);
k++;
assert.strictEqual(data.length, sliceSize);
}).on('end', () => {
示例6: it
it('with variadic arguments ', async () => assert.strictEqual(await proxy.$d(...[2, 3, 4]), 9))
示例7: dispose
sources.other.subscribe(x => {
assert.strictEqual(x, 97);
dispose();
done();
});
示例8: Date
assert.ok(op.lt('', 'a'));
assert.ok(op.lt(new Date(0), new Date()))
assert.ok(op.le(1, 2));
assert.ok(op.ge(2, 1));
assert.ok(op.gt(2, 1));
assert.ok(op.eq(1, 1));
assert.ok(op.ne(1, 2));
assert.ok(op.is(1, 1));
assert.ok(op.isnt(1, 2));
assert.ok(op.isIn('isIn', op));
assert.ok(op.not(false));
assert.ok(op.truth(1));
assert.ok(op.and(1, true));
assert.ok(op.or(true, false));
assert.strictEqual(op.add(1, 2), 3);
assert.strictEqual(op.sub(1, 2), -1);
assert.strictEqual(op.mul(1, 2), 2);
assert.strictEqual(op.div(1, 2), 0.5);
assert.strictEqual(op.floordiv(1, 2), 0);
assert.deepStrictEqual(op.divmod(1, 2), [0, 1]);
assert.strictEqual(op.mod(1, 2), 1);
assert.strictEqual(op.pos(-1), -1);
assert.strictEqual(op.neg(-1), 1);
assert.strictEqual(op.and_(1, 2), 0);
assert.strictEqual(op.or_(1, 2), 3);
assert.strictEqual(op.invert(1), -2);
assert.strictEqual(op.xor(1, 2), 3);
assert.strictEqual(op.lshift(1, 2), 4);
assert.strictEqual(op.rshift(1, 2), 0);