Skip to content

Commit

Permalink
Add test env to preview test setup
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicgamedeveloper committed Dec 17, 2024
1 parent fecd5f0 commit e689979
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"start": "serve -s build -l 4000",
"stop": "npx kill-port 4000",
"syntax": "npx eslint . --fix",
"test:all": "yarn test:unit && yarn test:int && yarn test:e2e",
"test:all": "yarn test:unit && yarn test:int && yarn test:e2e && yarn test:preview:unit && yarn test:preview:int",
"test:e2e:ext": "cross-env ext=true yarn test:e2e",
"test:e2e": "yarn config:test && playwright test -c ./playwright.config.ts",
"test:coverage:int-unit": "npx istanbul-combine -d coverage/all -r lcov -r json -r text coverage/unit/coverage-final.json coverage/int/coverage-final.json coverage/preview/unit/coverage-final.json coverage/preview/int/coverage-final.json",
Expand Down
19 changes: 19 additions & 0 deletions client/test/preview/integration/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,22 @@ import 'test/preview/__mocks__/global_mocks';
beforeEach(() => {
jest.resetAllMocks();
});

window.env = {
...global.window.env,
REACT_APP_AUTH_AUTHORITY: 'https://example.com',
REACT_APP_ENVIRONMENT: 'test',
REACT_APP_URL: 'https://example.com',
REACT_APP_URL_BASENAME: 'mock_url_basename',
REACT_APP_URL_DTLINK: '/lab',
REACT_APP_URL_LIBLINK: '',
REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword',
REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/',
REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',
REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: '',

REACT_APP_CLIENT_ID: 'abc123',
REACT_APP_REDIRECT_URI: 'https://example.com',
REACT_APP_LOGOUT_REDIRECT_URI: 'https://example.com',
REACT_APP_GITLAB_SCOPES: 'openid profile read_user read_repository api',
};

0 comments on commit e689979

Please sign in to comment.