forked from pancakeswap/pancake-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): Added tests (pancakeswap#202)
* feat(test): Added tests * build: Updated github workflow * fix(build): Removed extraneous dependencies * chore: Reorganized test folder structure
- Loading branch information
1 parent
0d60365
commit 9535997
Showing
6 changed files
with
725 additions
and
639 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,11 @@ | ||
name: Tests | ||
on: push | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install modules | ||
run: yarn | ||
- name: Run Jest tests | ||
run: yarn 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import formatAddress from '../../utils/formatAddress' | ||
|
||
it.each([ | ||
['bc1qmkv9wumjy2yzgghf2jmuvzvua6hgauh5grnm59', 'bc1qmk...grnm59'], | ||
['bc1qexasackdmnfpslk8ncmlcprjqqcvzgkrdu5q6y', 'bc1qex...du5q6y'], | ||
['bc1q0xnppfz2merk59zcxsuqc7h0lkaw4ycts9y0nu', 'bc1q0x...s9y0nu'], | ||
['bc1qhyv7a33zq57nld3hpunk25hkfxfey3rpjxctcn', 'bc1qhy...jxctcn'], | ||
['bc1qh4hluzu3d3egwgwdk03xy8xrszd4q7vehttfww', 'bc1qh4...httfww'], | ||
['0x3249d704a6a80731d990857E54D8222916B1C161', '0x3249...B1C161'], | ||
])('format %s', (address, expected) => { | ||
expect(formatAddress(address)).toEqual(expected) | ||
}) |
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,13 @@ | ||
import getTimePeriods from '../../utils/getTimePeriods' | ||
|
||
it.each([ | ||
[40, { years: 0, months: 0, days: 0, hours: 0, minutes: 0, seconds: 40 }], | ||
[60, { years: 0, months: 0, days: 0, hours: 0, minutes: 1, seconds: 0 }], | ||
[70, { years: 0, months: 0, days: 0, hours: 0, minutes: 1, seconds: 10 }], | ||
[691200, { years: 0, months: 0, days: 8, hours: 0, minutes: 0, seconds: 0 }], | ||
[5259600, { years: 0, months: 2, days: 0, hours: 0, minutes: 0, seconds: 0 }], | ||
[94672800, { years: 3, months: 0, days: 0, hours: 0, minutes: 0, seconds: 0 }], | ||
[34277461, { years: 1, months: 1, days: 1, hours: 1, minutes: 1, seconds: 1 }], | ||
])('format %i seconds', (seconds, expected) => { | ||
expect(getTimePeriods(seconds)).toEqual(expected) | ||
}) |
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
Oops, something went wrong.