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

fix: use correct slashes on windows on test command #851

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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