Skip to content

Commit 9c6cbbf

Browse files
lukas-reinekengshiheng
authored andcommitted
NO-TICKET added unit tests
1 parent 55897ac commit 9c6cbbf

File tree

7 files changed

+4296
-571
lines changed

7 files changed

+4296
-571
lines changed

.circleci/config.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,36 @@ references:
44
pin-npm-version: &pin-npm-version
55
run:
66
name: Pin NPM to specified version
7-
command: sudo npm install -g npm@6.4.1
7+
command: sudo npm install -g npm@6.13.4
88

99
jobs:
1010
test:
1111
docker:
12-
- image: circleci/node:10.13.0
12+
- image: circleci/node:12
13+
14+
steps:
15+
- *pin-npm-version
16+
- checkout
17+
18+
- restore_cache:
19+
keys:
20+
- jscache-{{ checksum "package.json" }}
21+
- jscache-
22+
23+
- run: npm ci
24+
25+
- save_cache:
26+
paths:
27+
- node_modules
28+
key: jscache-{{ checksum "package.json" }}
29+
30+
- run: npm run test
31+
- store_test_results:
32+
path: test-results
33+
34+
lint:
35+
docker:
36+
- image: circleci/node:12
1337

1438
steps:
1539
- *pin-npm-version
@@ -28,12 +52,33 @@ jobs:
2852
key: jscache-{{ checksum "package.json" }}
2953

3054
- run: npm run lint
55+
56+
check-build:
57+
docker:
58+
- image: circleci/node:12
59+
60+
steps:
61+
- *pin-npm-version
62+
- checkout
63+
64+
- restore_cache:
65+
keys:
66+
- jscache-{{ checksum "package.json" }}
67+
- jscache-
68+
69+
- run: npm ci
70+
71+
- save_cache:
72+
paths:
73+
- node_modules
74+
key: jscache-{{ checksum "package.json" }}
75+
3176
- run: npm run build-ts
3277
- run: git diff --quiet || (echo 'build does not match' && exit 1)
3378

3479
publish:
3580
docker:
36-
- image: circleci/node:10.13.0
81+
- image: circleci/node:12
3782

3883
steps:
3984
- *pin-npm-version
@@ -57,7 +102,7 @@ jobs:
57102

58103
publish-hot:
59104
docker:
60-
- image: circleci/node:10.13.0
105+
- image: circleci/node:12
61106

62107
steps:
63108
- *pin-npm-version
@@ -70,14 +115,15 @@ workflows:
70115
version: 2
71116
test-and-publish:
72117
jobs:
73-
- test:
74-
filters:
75-
tags:
76-
only: /.*/
118+
- test
119+
- lint
120+
- check-build
77121
- publish:
78122
context: npm-publish
79123
requires:
80124
- test
125+
- lint
126+
- check-build
81127
filters:
82128
tags:
83129
only: /^v[0-9]+(\.[0-9]+)*(-rc\.[0-9]*)*/
@@ -87,6 +133,8 @@ workflows:
87133
context: npm-publish
88134
requires:
89135
- test
136+
- lint
137+
- check-build
90138
filters:
91139
tags:
92140
only: /^v[0-9]+(\.[0-9]+)*-hot/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11

22
node_modules
33
.rpt2_cache
4+
coverage
5+
test-results

index.node.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
reporters: ['default', 'jest-junit'],
3+
testMatch: ['**/tests/**/*'],
4+
transform: {
5+
'^.+\\.ts$': 'ts-jest',
6+
},
7+
};

0 commit comments

Comments
 (0)