-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates frontend server, adds Tests (#3297)
# Description and Motivation <!--- bulleted, high level items. use keywords (eg "closes #144" or "fixes #4323") --> - closes #3152 - refactors from commonjs requires() to esmodule import() style - re-enables dependabot on frontend server deps - enables super linter on frontend_server - refactors to use built in node fetch - pins node version (required due to built in fetch) ## Has this been tested? How? - new tests fails when intentionally breaking the code ## Screenshots (if appropriate) <img width="757" alt="Screenshot 2024-05-14 at 11 51 10 PM" src="https://github.com/SatcherInstitute/health-equity-tracker/assets/41567007/0a7b0bbd-b28d-453c-a692-55e6d98a6d2f"> ## Types of changes (leave all that apply) - Refactor / chore ## New frontend preview link is below in the Netlify comment 😎
- Loading branch information
1 parent
cd5a153
commit 15fac75
Showing
11 changed files
with
2,978 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: RUN Frontend Server Tests | ||
|
||
env: | ||
## Sets environment variables | ||
NETLIFY_SITE_NAME: 'health-equity-tracker' | ||
GITHUB_PR_NUMBER: ${{github.event.pull_request.number}} | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
paths: | ||
- 'frontend_server/**' # Run when changes occur in the frontend subfolder | ||
defaults: | ||
run: | ||
working-directory: frontend_server | ||
|
||
jobs: | ||
frontend_unit_tests: | ||
name: Runs frontend server unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: frontend_server/package.json | ||
cache: 'npm' | ||
cache-dependency-path: frontend_server/package-lock.json | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run Vitest unit tests | ||
run: npm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
NODE_ENV=production | ||
DEPLOY_CONTEXT=prod | ||
DISABLE_BASIC_AUTH=true | ||
METADATA_SERVER_TOKEN_URL=http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NODE_ENV=production | ||
DEPLOY_CONTEXT=prod | ||
DISABLE_BASIC_AUTH=true | ||
# for testing, this will hit mocky.io instead of the HET data_server | ||
METADATA_SERVER_TOKEN_URL=NULL | ||
DATA_SERVER_URL=https://run.mocky.io/v3/09b9fb81-e3f8-4a57-bac5-fd868bbd6fba | ||
BUILD_DIR=../frontend |
Oops, something went wrong.