Skip to content

Commit 2b57da8

Browse files
committed
Add core package test to CI
1 parent a820472 commit 2b57da8

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
- checkout
2020
- run: yarn install
2121
- run: yarn web-test-coverage
22+
- run: yarn core-test-coverage
2223
- codecov/upload:
2324
file: packages/web/coverage/*.json
2425
workflows:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22

33
# dependencies
4-
/node_modules
4+
node_modules
55
/.pnp
66
.pnp.js
77

88
# testing
9-
/coverage
9+
coverage
1010

1111
# production
1212
/build

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
],
88
"scripts": {
99
"core-test": "yarn workspace @interval-timer/core run test",
10+
"core-test-coverage": "yarn workspace @interval-timer/core run test --runInBand --coverage",
1011
"web": "yarn workspace @interval-timer/web run start",
1112
"web-build": "yarn workspace @interval-timer/web run build",
1213
"web-lint": "yarn workspace @interval-timer/web run lint:fix",

packages/core/src/hasOneSecondElapsed.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ describe('hasOneSecondElapsed()', () => {
1010
false
1111
);
1212
});
13+
it('should use current time by default', () => {
14+
const timestamp = 1587494146595;
15+
const currentTimeMock = 1587494147595;
16+
Date.now = jest.fn().mockReturnValueOnce(currentTimeMock);
17+
expect(hasOneSecondElapsed(timestamp)).toBe(true);
18+
});
1319
});

0 commit comments

Comments
 (0)