Commit c1cab6f7 authored by Tasso Evangelista's avatar Tasso Evangelista

Segregate main and renderer process unit tests

parent 46badbbc
......@@ -22,7 +22,9 @@
"release-mas-dev": "build --publish never --mac mas-dev --c.mac.provisioningProfile=Development.provisionprofile",
"lint": "eslint src",
"pretest": "gulp build-unit-tests --env=test",
"test": "electron-mocha app/specs.js.autogenerated --renderer --require source-map-support/register",
"test-main": "electron-mocha --require source-map-support/register app/main.specs.js",
"test-renderer": "electron-mocha --require source-map-support/register --renderer app/renderer.specs.js",
"test": "npm-run-all test-main test-renderer",
"coverage": "npm test -- -R scripts/istanbul-reporter",
"pree2e": "gulp build-e2e-tests --env=test",
"e2e": "mocha app/e2e.js.autogenerated --require source-map-support/register"
......@@ -56,6 +58,7 @@
"minimist": "^1.2.0",
"mocha": "^5.2.0",
"rollup": "^0.66.1",
"npm-run-all": "^4.1.3",
"rollup-plugin-istanbul": "^2.0.1",
"rollup-plugin-json": "^3.1.0",
"run-sequence": "^2.2.1",
......
'use strict';
const gulp = require('gulp');
const jetpack = require('fs-jetpack');
const bundle = require('./bundle');
......@@ -17,18 +15,23 @@ const createEntryFile = async(srcDir, matching, outputDir, entryFileName, rollup
srcDir.remove(entryFileName);
};
gulp.task('build-unit-tests', ['environment'], () => createEntryFile(
jetpack.cwd('src'), '*.spec.js',
jetpack.cwd('app'), 'specs.js.autogenerated',
{
gulp.task('build-unit-tests', ['environment'], () => {
const rollupOptions = {
rollupPlugins: [
istanbul({
exclude: ['**/*.spec.js', '**/specs.js.autogenerated'],
exclude: ['**/*.spec.js', '**/*.specs.js'],
sourcemap: true,
}),
],
}
));
};
return Promise.all([
createEntryFile(jetpack.cwd('src'), 'background/*.spec.js',
jetpack.cwd('app'), 'main.specs.js', rollupOptions),
createEntryFile(jetpack.cwd('src'), ['*.spec.js', '!background/*.spec.js'],
jetpack.cwd('app'), 'renderer.specs.js', rollupOptions),
]);
});
gulp.task('build-e2e-tests', ['build-app'], () => createEntryFile(
jetpack.cwd('src'), '*.e2e.js',
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment