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

Commit

Permalink
fix: use correct slashes on windows (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatme authored Apr 5, 2019
1 parent bd4fa9c commit 9020c47
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions unit-testing-config-loader.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const { join, relative } = require("path");
const { convertSlashesInPath } = require("./projectHelpers");

module.exports = function ({ appFullPath, projectRoot, angular, rootPagesRegExp }) {
// TODO: Consider to use the files property from karma.conf.js
const testFilesRegExp = /tests\/.*\.(ts|js)/;
const runnerFullPath = join(projectRoot, "node_modules", "nativescript-unit-test-runner");
const runnerRelativePath = relative(appFullPath, runnerFullPath);
const runnerRelativePath = convertSlashesInPath(relative(appFullPath, runnerFullPath));
let source = `
require("tns-core-modules/bundle-entry-points");
const runnerContext = require.context("${runnerRelativePath}", true, ${rootPagesRegExp});
Expand All @@ -24,7 +25,7 @@ module.exports = function ({ appFullPath, projectRoot, angular, rootPagesRegExp
`;
}

const runnerEntryPointPath = join(runnerRelativePath, "bundle-app.js");
const runnerEntryPointPath = convertSlashesInPath(join(runnerRelativePath, "bundle-app.js"));
source += `
require("${runnerEntryPointPath}");
`;
Expand Down

0 comments on commit 9020c47

Please sign in to comment.