Skip to content

Commit d5e9c46

Browse files
committed
test: remove potential set environment variable to avoid interference
1 parent 2534e77 commit d5e9c46

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

spec/gatsby-node.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jest.mock('#plugin', () => {
3535
};
3636
});
3737

38+
// unset any environment variables that may be set from the parent environment
39+
delete process.env['GATSBY_NOTION_TOKEN'];
40+
delete process.env['GATSBY_NOTION_DATABASES'];
41+
delete process.env['GATSBY_NOTION_PAGES'];
42+
3843
describe('fn:pluginOptionsSchema', () => {
3944
it('pass with no option provided at all', () => {
4045
expect(

spec/plugin.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jest.mock('#node', () => ({
3333

3434
const client = new Notion({ token: 'token' });
3535

36+
// unset any environment variables that may be set from the parent environment
37+
delete process.env['GATSBY_NOTION_TOKEN'];
38+
delete process.env['GATSBY_NOTION_DATABASES'];
39+
delete process.env['GATSBY_NOTION_PAGES'];
40+
3641
describe('fn:computeUpdateInterval', () => {
3742
it('compute the interval based on the total number of databases and pages', () => {
3843
expect(

0 commit comments

Comments
 (0)