-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly test reporting errors in fluent-react (#520)
* Run prettier on test files to minimize inline snapshot code diff Inline snapshots in Jest are powered by Prettier, however prettier does not appear to be hooked up to the eslint. https://jestjs.io/docs/en/snapshot-testing#inline-snapshots In the following commits I add new inline snapshot tests, which invalidates a lot of the existing formatting. This commit runs prettier on the entire test directory to ensure that the following commits have clean code diffs. * Spy on console.warn in tests, and throw an error if called The current tests aren't explicit on testing the behavior of what errors get reported. This makes it difficult to understand the current behavior. This commit adds a mechanism to fail a test if the console.warn is called unexpectedly. Following commits will fix up tests that fail from this new mechanism. * Add explicit checks for what happens with console.warn in tests These tests use the toMatchInlineSnapshot method to assert that an error message was called. The snapshot allows for easy updating if the error messages are re-phrased in the future.
- Loading branch information
Showing
11 changed files
with
576 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.