Skip to content

using quibble with momentjs #98

@t1a2l

Description

@t1a2l

moment is installed with npm, and is used throughout my code not just in the test.
I am trying to call a fake moment function instead of normal one, i am using sinon and was suggested to use quibble for this.
I see in the docs somethign with paths but i am doing this: (it is inside node modules)

const moment = require('moment') const jwt = require('jsonwebtoken'); describe('Admin logged in', () => { //create a sandbox so at the end we can release all fun at once. const sandbox = sinon.createSandbox(); before(async function() { sandbox.stub(jwt, 'verify').callsArgWith(2, null, scope);
how can i achieve a stub of an entire library with this package?

momentjs :
/** @param strict Strict parsing disables the deprecated fallback to the native Date constructor when parsing a string. */ declare function moment(inp?: moment.MomentInput, strict?: boolean): moment.Moment; export = moment; export as namespace moment;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions