@@ -27,11 +27,15 @@ const makeTransform = (filePath, buildPath) => {
|
||||
|
||||
// copy, then watch for changes to the tests
|
||||
const testsFromRoot = 'build/main/**/*.spec.js';
|
||||
const task = process.argv[2] === '-w' ? cpx.watch : cpx.copy;
|
||||
const watchMode = process.argv.indexOf('-w') !== -1 ? true : false;
|
||||
const browserTests = process.argv.indexOf('--no-browser') !== -1 ? true : false;
|
||||
const task = watchMode ? cpx.watch : cpx.copy;
|
||||
|
||||
task(testsFromRoot, 'test/main', {
|
||||
transform: (filePath) => makeTransform(filePath, pkg.main)
|
||||
})
|
||||
task(testsFromRoot, 'test/browser', {
|
||||
transform: (filePath) => makeTransform(filePath, pkg.browser.replace('.js', '.cjs.js'))
|
||||
})
|
||||
});
|
||||
if (!browserTests) {
|
||||
task(testsFromRoot, 'test/browser', {
|
||||
transform: (filePath) => makeTransform(filePath, pkg.browser.replace('.js', '.cjs.js'))
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user