當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript assert.strictEqual函數代碼示例

本文整理匯總了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');
 });
開發者ID:Codesleuth,項目名稱:esendex-node,代碼行數:4,代碼來源:messages.integration.test.ts

示例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');
	});
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:31,代碼來源:labels.test.ts

示例3: it

 it('should respond with status code 409 Conflict', () => {
   assert.strictEqual(statusCode, 409)
 })
開發者ID:TechNottingham,項目名稱:Hack24-API,代碼行數:3,代碼來源:hacks.test.ts

示例4: done

 dummySocket.once('myservice testing', data => {
   assert.strictEqual(data, 'hi');
   done();
 });
開發者ID:feathersjs,項目名稱:feathers,代碼行數:4,代碼來源:utils.test.ts

示例5:

 volume.onSlice((sliceNum: number, data: Buffer) => {
     assert.strictEqual(sliceNum, k);
     k++;
     assert.strictEqual(data.length, sliceSize);
 }).on('end', () => {
開發者ID:Enet4,項目名稱:nifti-stream,代碼行數:5,代碼來源:test.ts

示例6: it

 it('with variadic arguments ', async () => assert.strictEqual(await proxy.$d(...[2, 3, 4]), 9))
開發者ID:JoYiRis,項目名稱:sourcegraph,代碼行數:1,代碼來源:proxy.test.ts

示例7: dispose

 sources.other.subscribe(x => {
   assert.strictEqual(x, 97);
   dispose();
   done();
 });
開發者ID:,項目名稱:,代碼行數:5,代碼來源:

示例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);
開發者ID:kaleb,項目名稱:js-op,代碼行數:31,代碼來源:test.ts


注:本文中的assert.strictEqual函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。