Skip to content

Fixed bug #48 - cannot mock an array - #52

Open
alexandreFromage wants to merge 2 commits into
iammerrick:masterfrom
alexandreFromage:master
Open

Fixed bug #48 - cannot mock an array#52
alexandreFromage wants to merge 2 commits into
iammerrick:masterfrom
alexandreFromage:master

Conversation

@alexandreFromage

Copy link
Copy Markdown

When registering a module, uses define(name, deps, callback) instead of define(name, callback).
This allows one to mock a module returning an array.
Indeed, if an array is passed as the second parameter, Require will assume it references dependencies and will try to load them.

electron added 2 commits May 10, 2014 22:20
When registering a module, uses define(name, deps, callback) instead of define(name, callback).
This allows one to mock a module returning an array. Indeed, if an array is passed as the second parameter, Require will assume it references dependencies.
@maniator

Copy link
Copy Markdown

Can't you just use Squire.helpers.returns(myMockArray)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants