Skip to content

Commit

Permalink
test: fix error message tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnns committed Mar 20, 2017
1 parent 39772a5 commit cd1734d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/helpers/compareErrorMessage.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const path = require('path');

const projectPath = path.resolve(__dirname, '..', '..');
const projectPath = path.resolve(__dirname, '..', '..').replace(/\\/g, '/');
const projectPathPattern = new RegExp(projectPath, 'g');
const CR = /\r/g;

// We need to remove all environment dependent features
function compareErrorMessage(msg) {
const envIndependentMsg = msg
.replace(projectPathPattern, '')
.replace(/\\/g, '/');
.replace(/\\/g, '/')
.replace(CR, '')
.replace(projectPathPattern, '');

expect(envIndependentMsg).toMatchSnapshot();
}
Expand Down

0 comments on commit cd1734d

Please sign in to comment.