Skip to content

Commit

Permalink
Fix Jest error.
Browse files Browse the repository at this point in the history
Background: Running Jest without the testUrl option results in the following error:

"localStorage is not available for opaque origins"

jestjs/jest#6766
  • Loading branch information
viralganatra committed Sep 5, 2018
1 parent e7fabc1 commit 33ccbe0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/configs/jest/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ const here = (p) => path.join(__dirname, p);
const useBuiltInBabelConfig = !hasFile('.babelrc') && !hasPkgProp('babel');

const jestConfig = {
rootDir: fromRoot('src'),
coverageDirectory: path.join(fromRoot('src'), '../coverage'),
rootDir: fromRoot('src'),
setupFiles: [here('../enzyme/config.js')],
setupTestFrameworkScriptFile: here('./setup.js'),
snapshotSerializers: ['enzyme-to-json/serializer'],
testURL: 'http://localhost',
};

if (useBuiltInBabelConfig) {
Expand Down

0 comments on commit 33ccbe0

Please sign in to comment.