updated backend unit test gulp tasks

This commit is contained in:
Carlos Jimenez Ruiz 2019-02-13 10:00:56 +01:00
parent bfaf9b1ed4
commit 25d8e06c1d
1 changed files with 14 additions and 5 deletions

View File

@ -74,7 +74,7 @@ defaultTask.description = `Starts all application services`;
// Backend tests // Backend tests
async function backTestOnly() { async function backTestOnce() {
let bootOptions; let bootOptions;
if (argv['random']) if (argv['random'])
@ -107,11 +107,19 @@ async function backTestOnly() {
await app.disconnect(); await app.disconnect();
} }
backTestOnly.description = `Runs the backend tests only, can receive --junit arg to save reports on a xml file`; backTestOnce.description = `Runs the backend tests once, can receive --junit arg to save reports on a xml file`;
async function backTestDockerOnce() {
let containerId = await docker();
await backTestOnce();
if (argv['random'])
await execP(`docker rm -fv ${containerId}`);
}
backTestDockerOnce.description = `Runs backend tests using in site container once`;
async function backTestDocker() { async function backTestDocker() {
let containerId = await docker(); let containerId = await docker();
await backTestOnly(); await backTest();
if (argv['random']) if (argv['random'])
await execP(`docker rm -fv ${containerId}`); await execP(`docker rm -fv ${containerId}`);
} }
@ -122,7 +130,7 @@ function backTest(done) {
nodemon({ nodemon({
exec: ['node ./node_modules/gulp/bin/gulp.js'], exec: ['node ./node_modules/gulp/bin/gulp.js'],
args: ['backTestOnly'], args: ['backTestOnce'],
watch: backSources, watch: backSources,
done: done done: done
}); });
@ -484,8 +492,9 @@ module.exports = {
back, back,
backOnly, backOnly,
backWatch, backWatch,
backTestOnce,
backTestDockerOnce,
backTest, backTest,
backTestOnly,
backTestDocker, backTestDocker,
e2e, e2e,
e2eOnly, e2eOnly,