Skip to content

Commit

Permalink
More consistent snapshots on windows (facebook#28482)
Browse files Browse the repository at this point in the history
Summary:
Get jest tests to be runnable on windows, and match current snapshots

## Changelog

[Internal] [Fixed] - More consistent snapshots on windows
Pull Request resolved: facebook#28482

Test Plan: run `yarn test` on a windows machine, and hit the test_windows circleci tests

Reviewed By: hramos

Differential Revision: D20799002

Pulled By: cpojer

fbshipit-source-id: da3db0171c34a43199c7d3dc17b622b37bc91701
  • Loading branch information
acoates-ms authored and facebook-github-bot committed Apr 1, 2020
1 parent 2e085a3 commit 5b26709
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const transform = (fixture, filename) =>
filename: filename,
highlightCode: false,
plugins: [require('@babel/plugin-syntax-flow'), require('../index')],
}).code.replace(/^[A-Z]:\\/g, '/'); // Ensure platform consistent snapshots.
}).code;

describe('Babel plugin inline view configs', () => {
Object.keys(fixtures)
Expand All @@ -37,7 +37,12 @@ describe('Babel plugin inline view configs', () => {
.forEach(fixtureName => {
it(`fails on inline config for ${fixtureName}`, () => {
expect(() => {
transform(failures[fixtureName], fixtureName);
try {
transform(failures[fixtureName], fixtureName);
} catch (err) {
err.message = err.message.replace(/^[A-z]:\\/g, '/'); // Ensure platform consistent snapshots.
throw err;
}
}).toThrowErrorMatchingSnapshot();
});
});
Expand Down

0 comments on commit 5b26709

Please sign in to comment.