Skip to content

Remove mockedFunction for Node.js test runner mock fn #188

@fraxken

Description

@fraxken

Use the Node.js test runner mock.fn instead of the current mockedFunction (we dit that because mock was not available at the time).

export function mockedFunction() {
return {
called: 0,
args: [],
at(position) {
return this.args[position];
},
haveBeenCalledTimes(count = 0) {
return this.called === count;
},
haveBeenCalledWith(value) {
return this.args.includes(value);
},
callback(...args) {
this.args.push(...args);
this.called++;
}
};
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions