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

Commit 7fa376d

Browse files
author
vakrilov
committed
test: add code coverage with nyc
1 parent 2978b81 commit 7fa376d

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ bundle-config-loader.js
3636

3737
hooks
3838
.DS_Store
39-
39+
.nyc_output
40+
coverage
4041
!projectHelpers.spec.js

Diff for: .nycrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "@istanbuljs/nyc-config-typescript",
3+
"exclude": ["/demo/**"],
4+
"reporter": ["text", "lcov"]
5+
}

Diff for: jasmine-config/jasmine.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"spec_files": [
44
"!node_modules/**/*.spec.js",
55
"!demo/**/*.spec.js",
6-
"./*.spec.js"
6+
"./**/*.spec.js"
77
],
88
"helpers": [
99
"jasmine-config/**/*.js"

Diff for: package.json

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"prepare": "npm run tsc && npm run jasmine",
3636
"test": "npm run prepare",
3737
"jasmine": "jasmine --config=jasmine-config/jasmine.json",
38+
"coverage": "nyc npm run test",
3839
"version": "rm package-lock.json && conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
3940
},
4041
"bin": {
@@ -77,6 +78,7 @@
7778
"devDependencies": {
7879
"@angular/compiler": "8.2.0",
7980
"@angular/compiler-cli": "8.2.0",
81+
"@istanbuljs/nyc-config-typescript": "^0.1.3",
8082
"@ngtools/webpack": "8.2.0",
8183
"@types/jasmine": "^3.3.7",
8284
"@types/loader-utils": "^1.1.3",
@@ -87,7 +89,9 @@
8789
"conventional-changelog-cli": "^1.3.22",
8890
"jasmine": "^3.2.0",
8991
"jasmine-spec-reporter": "^4.2.1",
92+
"nyc": "^14.1.1",
9093
"proxyquire": "2.1.0",
94+
"source-map-support": "^0.5.13",
9195
"tns-core-modules": "next",
9296
"typescript": "~3.5.3"
9397
}

Diff for: templates/webpack.config.spec.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ const nativeScriptDevWebpack = {
3232
getEntryModule: () => 'EntryModule',
3333
getResolver: () => null,
3434
getConvertedExternals: nsWebpackIndex.getConvertedExternals,
35-
getSourceMapFilename: nsWebpackIndex.getSourceMapFilename
35+
getSourceMapFilename: nsWebpackIndex.getSourceMapFilename,
36+
processAppComponents: nsWebpackIndex.processAppComponents,
37+
getUserDefinedEntries: nsWebpackIndex.getUserDefinedEntries,
3638
};
3739

40+
41+
3842
const emptyObject = {};
3943
const FakeAotTransformerFlag = "aot";
4044
const FakeHmrTransformerFlag = "hmr";

0 commit comments

Comments
 (0)