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

Commit 9b3b5a7

Browse files
committed
chore: share the regex for root|page between bundle-config loader and unit-testing config loader
1 parent 16a06c8 commit 9b3b5a7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Diff for: bundle-config-loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function (source) {
55
const { angular = false, loadCss = true, unitTesting, projectRoot, appFullPath, registerModules = /(root|page)\.(xml|css|js|ts|scss)$/ } = this.query;
66

77
if (unitTesting) {
8-
source = unitTestingConfigLoader({ appFullPath, projectRoot, angular, registerModules });
8+
source = unitTestingConfigLoader({ appFullPath, projectRoot, angular, rootPagesRegExp: registerModules });
99
this.callback(null, source);
1010
return;
1111
}

Diff for: unit-testing-config-loader.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
const { join, relative } = require("path");
22

3-
module.exports = function ({ appFullPath, projectRoot, angular }) {
3+
module.exports = function ({ appFullPath, projectRoot, angular, rootPagesRegExp }) {
44
// TODO: Consider to use the files property from karma.conf.js
55
const testFilesRegExp = /tests\/.*\.js/;
6-
const rootPagesRegExp = /(root|page)\.(xml|css|js|ts|scss)/;
76
const runnerFullPath = join(projectRoot, "node_modules", "nativescript-unit-test-runner");
87
const runnerRelativePath = relative(appFullPath, runnerFullPath);
98
let source = `

0 commit comments

Comments
 (0)