How to use the test-drive.sinon.spy function in test-drive

To help you get started, we’ve selected a few test-drive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wix / wix-react-tools / test / class-decor / method-force.spec.ts View on Github external
describe('method forcing', () => {
    const spy = sinon.spy();

    afterEach("reset console.warn", () => {
        spy.reset();
    });

    function middlewareHook(this: any, next: (...args: any[]) => any, methodArguments: any[]) {
        spy();
        return next(...methodArguments);
    }

    function beforeHook(this: any, methodArguments: any[]) {
        spy();
        return methodArguments;
    }

    function afterHook(this: any, methodResult: any) {

test-drive

Opinionated library for writing web component tests

MIT
Latest version published 2 months ago

Package Health Score

70 / 100
Full package analysis

Popular test-drive functions