Skip to content

Commit

Permalink
refactor: move process.env file to a separate file and mock it
Browse files Browse the repository at this point in the history
  • Loading branch information
suretrust committed Oct 6, 2023
1 parent b9aa637 commit 07d15d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/App.test.tsx
Expand Up @@ -2,6 +2,12 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';

jest.mock('./api/secret', () => {
return {
POLYGON_API_KEY: 'test',
};
})

it('renders learn react link', () => {
render(<App />);

Expand Down
1 change: 1 addition & 0 deletions src/api/secret.tsx
@@ -0,0 +1 @@
export const POLYGON_API_KEY = process.env.REACT_APP_POLYGON_API_KEY;

0 comments on commit 07d15d1

Please sign in to comment.