本文整理匯總了TypeScript中Sinon.assert.alwaysCalledWith方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript assert.alwaysCalledWith方法的具體用法?TypeScript assert.alwaysCalledWith怎麽用?TypeScript assert.alwaysCalledWith使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sinon.assert
的用法示例。
在下文中一共展示了assert.alwaysCalledWith方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("using PromiseReactionTask executor as first argument", () => {
var reactions = reactionsHelpers.createFakeReactions(3),
expectedResolution = { value: "Yoopie !" };
abstract.triggerPromiseReaction(reactions, expectedResolution);
sinon.assert.alwaysCalledWith(enqueueTaskStub, abstract.PromiseReactionTask);
});
示例2: it
it('calls the predicate in the same context and forward value arguments', function () {
const exampleContext = {example: 'context'};
const stub = sinon.stub().returns(true);
const args = [1, '2', null];
undefinedOr(stub).call(exampleContext, ...args);
undefinedOr.call(exampleContext, stub, ...args);
sinon.assert.calledTwice(stub);
sinon.assert.alwaysCalledOn(stub, exampleContext);
sinon.assert.alwaysCalledWith(stub, ...args);
});
示例3: setTimeout
setTimeout(() => {
sinon.assert.calledTwice(spy);
sinon.assert.alwaysCalledWith(spy, div);
div.style.width = "450px";
div.parentNode.removeChild(div);
setTimeout(() => {
sinon.assert.calledTwice(spy);
done();
}, 150);
}, 150);
示例4: test
test('accepts pagination params', () => {
const options: FindOptions = { perPage: 10, page: 6 };
savedObjectsClient.find(options);
sinon.assert.calledOnce(kfetchStub);
sinon.assert.alwaysCalledWith(
kfetchStub,
sinon.match({
pathname: `/api/saved_objects/_find`,
query: { per_page: 10, page: 6 },
})
);
});