Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 24fcf53

Browse files
committed
test: setup Jasmine for unit testing
1 parent 1f95c56 commit 24fcf53

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ transformers/ns-replace-bootstrap.d.ts
1111
transformers/ns-replace-bootstrap.js
1212
transformers/ns-replace-bootstrap.js.map
1313

14-
transformers/ast-utils.d.ts
15-
transformers/ast-utils.js
16-
transformers/ast-utils.js.map
17-
1814
plugins/PlatformFSPlugin.d.ts
1915
plugins/PlatformFSPlugin.js
2016
plugins/PlatformFSPlugin.js.map
@@ -27,5 +23,12 @@ host/resolver.d.ts
2723
host/resolver.js
2824
host/resolver.js.map
2925

26+
jasmine-config/reporter.d.ts
27+
jasmine-config/reporter.js
28+
jasmine-config/reporter.js.map
29+
30+
**/*.spec.js*
31+
**/*.spec.d.ts*
32+
3033
hooks
3134
.DS_Store

jasmine-config/jasmine.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"spec_dir": ".",
3+
"spec_files": [
4+
"./!(node_modules)/**/*.spec.js"
5+
],
6+
"helpers": [
7+
"jasmine-config/**/*.js"
8+
],
9+
"stopSpecOnExpectationFailure": false,
10+
"random": false
11+
}

jasmine-config/reporter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { SpecReporter } from "jasmine-spec-reporter";
2+
3+
jasmine.getEnv().clearReporters();
4+
jasmine.getEnv().addReporter(new SpecReporter());

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
"scripts": {
5656
"postinstall": "node postinstall.js",
5757
"prepare": "tsc",
58+
"test": "npm run prepare && npm run jasmine",
59+
"jasmine": "jasmine --config=jasmine-config/jasmine.json",
5860
"version": "rm package-lock.json && conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
5961
},
6062
"bin": {
@@ -92,9 +94,12 @@
9294
"sass-loader": "~7.0.1"
9395
},
9496
"devDependencies": {
97+
"@ngtools/webpack": "~6.2.0-beta.3",
98+
"@types/jasmine": "^2.8.8",
9599
"@types/node": "^8.0.0",
96100
"conventional-changelog-cli": "^1.3.22",
97-
"typescript": "~2.9.1",
98-
"@ngtools/webpack": "~6.2.0-beta.3"
101+
"jasmine": "^3.2.0",
102+
"jasmine-spec-reporter": "^4.2.1",
103+
"typescript": "~2.9.1"
99104
}
100105
}

0 commit comments

Comments
 (0)