本文整理匯總了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');
});