Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading from 0.2.4 to 0.3.0 #10

Open
richardlay opened this issue Feb 18, 2019 · 1 comment
Open

Upgrading from 0.2.4 to 0.3.0 #10

richardlay opened this issue Feb 18, 2019 · 1 comment

Comments

@richardlay
Copy link

richardlay commented Feb 18, 2019

My tests broke when I upgraded from 0.2.4 to 0.3.0.

An example scenario:

fixtures.save('mockAccount', {
    account: {
        username: 'one', password: 'pass'
    }
});

fixtures('mockAccount', function(err, data) {
    
});

In 0.2.4, data looked like

[
    {
        username: "one",
        password: "pass"
    }
]

In 0.3.0, data looks like

[
    [
        {
            username: "one",
            password: "pass"
        }
    ]
]

Looks like it is caused from a change in lib/index.js line 28: create was changed to insertMany.

Is this expected?

@richardlay
Copy link
Author

richardlay commented Feb 18, 2019

Just looking into this a bit more, in lib/index.js line 29 the arguments index contains the result of the insert.

For create, a single item fixture such as the one I'm using above will return an object as the result. However with insertMany it will return an array.

Is there any chance we can keep the previous behaviour for single item fixtures?

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

No branches or pull requests

1 participant