本文整理汇总了TypeScript中Sinon.assert.neverCalledWith方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.neverCalledWith方法的具体用法?TypeScript assert.neverCalledWith怎么用?TypeScript assert.neverCalledWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sinon.assert
的用法示例。
在下文中一共展示了assert.neverCalledWith方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test("test for parse user-define component.", (t) => {
const element = obtainElementTag(gomlParserTestCasePath3);
const node = GomlParser.parse(element);
node.setMounted(true);
t.truthy(node.children.length === 1); // only test-node1
t.truthy(node.children[0].getAttribute("testAttr1") === "hugahuga"); // goml default
t.truthy(node.children[0].getAttribute("hoge") === "DEFAULT"); // component default
t.truthy(node.children[0].children.length === 1);
t.truthy(node.children[0].children[0].getAttribute("testAttr2") === "123");
node.broadcastMessage("onTest", "testArg");
sinon.assert.neverCalledWith(testComponent1Spy, "testArg");
sinon.assert.neverCalledWith(testComponent2Spy, "testArg");
sinon.assert.neverCalledWith(testComponentOptionalSpy, "testArg");
t.truthy("testArg" === testComponentBaseSpy.args[2][1]);
});
示例2: it
it('fails if token from the state is rejected because of unknown reason.', async () => {
const request = requestFixture();
const failureReason = { statusCode: 500, message: 'Token is not valid!' };
callWithRequest.withArgs(request, 'shield.authenticate').rejects(failureReason);
const authenticationResult = await provider.authenticate(request, {
accessToken: 'some-invalid-token',
refreshToken: 'some-invalid-refresh-token',
});
expect(request.headers).not.toHaveProperty('authorization');
expect(authenticationResult.failed()).toBe(true);
expect(authenticationResult.error).toBe(failureReason);
sinon.assert.neverCalledWith(callWithRequest, 'shield.getAccessToken');
});