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

fix: inject app.css file from unit-test-runner on test command #949

Merged
merged 1 commit into from
Jun 26, 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
3 changes: 3 additions & 0 deletions unit-testing-config-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ module.exports = function ({ appFullPath, projectRoot, angular, rootPagesRegExp
const testFilesRegExp = /tests\/.*\.(ts|js)/;
const runnerFullPath = join(projectRoot, "node_modules", "nativescript-unit-test-runner");
const runnerRelativePath = convertSlashesInPath(relative(appFullPath, runnerFullPath));
const appCssFilePath = join(runnerRelativePath, "app.css");
let source = `
require("tns-core-modules/bundle-entry-points");
const runnerContext = require.context("${runnerRelativePath}", true, ${rootPagesRegExp});
global.registerWebpackModules(runnerContext);
global.registerModule("${appCssFilePath}", () => require("${appCssFilePath}"));
require("tns-core-modules/application").setCssFileName("${appCssFilePath}");
`;

if (angular) {
Expand Down