Skip to content

Conversation

@zebateira
Copy link
Contributor

@zebateira zebateira commented Sep 4, 2019

Currently, if the file is not found, the plugin doesn't crash the build or logs the error, so there's no way for a developer to now that the issue is with the path provided to the json files.

I added the extra log console.error('[gatsby-plugin-intl] error', error) to signal that the issue is being logged from this plugin, but maybe this is not necessary.
In any case, throwing the error I think should be the default behavior. What do you think?

I also added some tests to validate this change, but the tests didn't seem to be working:

  • added webpack mock to be able to run the tests.
  • added context: {} to the mock object.
  • added jest to the dev dependencies so you don't need to have it globally installed

Let me know if you want me to restore the tests back to how they were before.

create test for success reading the files.
create test for failure when file couldn't be found.
@wiziple wiziple changed the base branch from master to versions/0.3.0 October 26, 2019 01:58
@wiziple wiziple merged commit d19c82e into wiziple:versions/0.3.0 Oct 26, 2019
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