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

Unable to override default data with file fixture #85

Open
adrifmonte opened this issue Jun 11, 2021 · 1 comment
Open

Unable to override default data with file fixture #85

adrifmonte opened this issue Jun 11, 2021 · 1 comment

Comments

@adrifmonte
Copy link

For example:

server.routes([
  {
    path: '/dogs',
    methods: [
      {
        type: 'get',
        code: 204,
        data: [],
        overrides: [
          {
            name: 'golden-retriever',
            code: 200,
            file: 'data/golden-retriever.json'
          }
        ]
      },
    ],
  },
]);

While Applying the golden-retriever override, when acessing /dogs it will return:

{
  code: 200,
  response: []
}

It works fine when overriding a default data with another data override.
It also works as expected when overriding a default file with both data and file overrides.

@fsmaia
Copy link
Collaborator

fsmaia commented Jun 11, 2021

Humm, interesting! Maybe this could be the expected behavior.

IMHO it will be worse if the override clears all the response attributes, it wouldn't be intuitive.

What are your thoughts @rhberro?

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

2 participants