Skip to content

Commit

Permalink
test: remove potential set environment variable to avoid interference
Browse files Browse the repository at this point in the history
  • Loading branch information
alvis committed Aug 15, 2022
1 parent 2534e77 commit d5e9c46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/gatsby-node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jest.mock('#plugin', () => {
};
});

// unset any environment variables that may be set from the parent environment
delete process.env['GATSBY_NOTION_TOKEN'];
delete process.env['GATSBY_NOTION_DATABASES'];
delete process.env['GATSBY_NOTION_PAGES'];

describe('fn:pluginOptionsSchema', () => {
it('pass with no option provided at all', () => {
expect(
Expand Down
5 changes: 5 additions & 0 deletions spec/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ jest.mock('#node', () => ({

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

// unset any environment variables that may be set from the parent environment
delete process.env['GATSBY_NOTION_TOKEN'];
delete process.env['GATSBY_NOTION_DATABASES'];
delete process.env['GATSBY_NOTION_PAGES'];

describe('fn:computeUpdateInterval', () => {
it('compute the interval based on the total number of databases and pages', () => {
expect(
Expand Down

0 comments on commit d5e9c46

Please sign in to comment.