Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jun 28, 2021
1 parent 14abbb1 commit 242525a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
"tsConfig": "./tsconfig.json",
"diagnostics": false
}
}
},
"setupFiles": [
"<rootDir>/test/setEnvVars.ts"
]
},
"sideEffects": false
}
3 changes: 1 addition & 2 deletions packages/gatsby/test/gatsby-node.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-explicit-any */

const { onCreateWebpackConfig } = require('../gatsby-node');

describe('onCreateWebpackConfig', () => {
Expand All @@ -18,7 +17,7 @@ describe('onCreateWebpackConfig', () => {
expect(plugins.define).toHaveBeenCalledTimes(1);
expect(plugins.define).toHaveBeenLastCalledWith({
__SENTRY_DSN__: expect.any(String),
__SENTRY_RELEASE__: undefined,
__SENTRY_RELEASE__: expect.any(String),
});

expect(actions.setWebpackConfig).toHaveBeenCalledTimes(1);
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby/test/setEnvVars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
process.env.SENTRY_RELEASE = '14abbb1678a2eb59d1a171ea33d630dd6c6eee70';

0 comments on commit 242525a

Please sign in to comment.