-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial jest testing * add to git actions * testing to see if this fixes our craco tests * testing to see if this fixes our craco tests * fix exports of helpers * added configs for both jest and craco to use * seperated workflows and renamed them to be clearer
- Loading branch information
1 parent
50cf783
commit 4420f1a
Showing
12 changed files
with
346 additions
and
470 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn --cwd ./frontend/app install | ||
- name: Build | ||
run: CI=false yarn --cwd ./frontend/app run build | ||
|
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,17 @@ | ||
name: Eslint | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
eslint: | ||
name: eslint | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn --cwd ./frontend/app install | ||
- name: Eslint | ||
run: yarn --cwd ./frontend/app run lint | ||
|
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,18 @@ | ||
name: Prettier | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
|
||
prettier: | ||
name: prettier | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn --cwd ./frontend/app install | ||
- name: Prettier | ||
run: CI=false yarn --cwd ./frontend/app run prettier:check | ||
|
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,34 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
test: | ||
name: Craco | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn --cwd ./frontend/app install | ||
- name: Tests | ||
run: NODE_OPTIONS="--max_old_space_size=8192" yarn --cwd ./frontend/app run test | ||
- name: Set up Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
- name: Go Test | ||
run: go test -v ./... | ||
|
||
test-jest: | ||
name: Jest | ||
runs-on: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn --cwd ./frontend/app install | ||
- name: Tests | ||
run: NODE_OPTIONS="--max_old_space_size=8192" yarn --cwd ./frontend/app run test-jest | ||
|
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{} |
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,36 @@ | ||
{ | ||
"collectCoverage": true, | ||
"collectCoverageFrom": [ | ||
"./src/components/**/*.js", | ||
"./src/helpers/**/*.ts", | ||
"./src/leaderboard/**/*.ts", | ||
"./src/pages/**/*.ts", | ||
"./src/people/**/*.ts", | ||
"./src/tribes/**/*.ts" | ||
], | ||
"coverageThreshold": { | ||
"global": { | ||
"lines": 0 | ||
}, | ||
"./src/people/utils/": { | ||
"lines": 0 | ||
}, | ||
"./src/helpers/": { | ||
"lines": 66 | ||
} | ||
}, | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js", | ||
"json", | ||
"node" | ||
], | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"globals": { | ||
"window": { "location": {"host": "localhost"}}, | ||
"testEnvironment": "jsdom" | ||
|
||
} | ||
} |
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
13 changes: 0 additions & 13 deletions
13
frontend/app/src/helpers/helpers.ts → frontend/app/src/helpers/helpers-extended.ts
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,15 @@ | ||
import { uiStore } from '../store/ui'; | ||
|
||
export const satToUsd = (amount: number = 0) => { | ||
if (!amount) amount = 0; | ||
const satExchange = uiStore.usdToSatsExchangeRate; | ||
const returnValue = (amount / satExchange).toFixed(2); | ||
|
||
if (returnValue === 'Infinity' || isNaN(parseFloat(returnValue))) { | ||
return '. . .'; | ||
} | ||
|
||
return returnValue; | ||
}; | ||
|
||
export * from './helpers-extended'; |
Oops, something went wrong.