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

fix: add support for executing unit tests for vue projects #839

Merged
merged 3 commits into from
Mar 21, 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
15 changes: 15 additions & 0 deletions templates/webpack.vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,21 @@ module.exports = env => {
],
};

if (unitTesting) {
config.module.rules.push(
{
test: /-page\.js$/,
use: "nativescript-dev-webpack/script-hot-loader"
},
{
test: /\.(html|xml)$/,
use: "nativescript-dev-webpack/markup-hot-loader"
},

{ test: /\.(html|xml)$/, use: "nativescript-dev-webpack/xml-namespace-loader"}
);
}

// Copy the native app resources to the out dir
// only if doing a full build (tns run/build) and not previewing (tns preview)
if (!externals || externals.length === 0) {
Expand Down