本文整理汇总了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 },
})
);
});