#1042 gulp backTest fixed
This commit is contained in:
parent
366527d87e
commit
f9c79241ae
|
@ -1,4 +1,4 @@
|
|||
const app = require(`${serviceRoot}/server/server`);
|
||||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('account login()', () => {
|
||||
describe('when credentials are correct', () => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const app = require(`${serviceRoot}/server/server`);
|
||||
const app = require('vn-loopback/server/server');
|
||||
|
||||
describe('account logout()', () => {
|
||||
it('should logout and remove token after valid login', async() => {
|
||||
|
|
35
gulpfile.js
35
gulpfile.js
|
@ -61,16 +61,14 @@ backOnly.description = `Starts backend service`;
|
|||
|
||||
// backend tests
|
||||
|
||||
function backTestOnly() {
|
||||
serviceRoot = 'vn-loopback';
|
||||
function backendUnitTest() {
|
||||
let app = require(`./loopback/server/server`);
|
||||
|
||||
let specFiles = [
|
||||
`./back/**/*.spec.js`,
|
||||
`./loopback/**/*.spec.js`
|
||||
'back/**/*.spec.js',
|
||||
'loopback/**/*.spec.js',
|
||||
'modules/*/back/**/*.spec.js'
|
||||
];
|
||||
for (let mod of modules)
|
||||
specFiles.push(`./modules/${mod}/back/**/*.spec.js`);
|
||||
|
||||
const jasmine = require('gulp-jasmine');
|
||||
const reporters = require('jasmine-reporters');
|
||||
|
@ -85,16 +83,22 @@ function backTestOnly() {
|
|||
app.disconnect();
|
||||
});
|
||||
}
|
||||
backTestOnly.description = `Runs the backend tests only, can receive args --junit or -j to save reports on a xml file`;
|
||||
backendUnitTest.description = `Runs the backend tests only, can receive args --junit or -j to save reports on a xml file`;
|
||||
|
||||
const backendTest = gulp.series(docker, backTestOnly);
|
||||
backendTest.description = `Restarts database and runs the backend tests`;
|
||||
const dockerAndBackTest = gulp.series(docker, backendUnitTest);
|
||||
dockerAndBackTest.description = `Restarts database and runs the backend tests`;
|
||||
|
||||
const backTest = gulp.parallel(backendTest, done => {
|
||||
gulp.watch('modules', gulp.series(backendTest));
|
||||
done();
|
||||
});
|
||||
backTest.description = `Watches for changes in modules to execute backendTest task`;
|
||||
function backTest(done) {
|
||||
const nodemon = require('gulp-nodemon');
|
||||
|
||||
nodemon({
|
||||
script: 'node_modules/.bin/gulp',
|
||||
args: ['dockerAndBackTest'],
|
||||
watch: ['loopback', 'modules/*/back/**', 'back'],
|
||||
done: done
|
||||
});
|
||||
}
|
||||
backTest.description = `Watches for changes in modules to execute backTest task`;
|
||||
|
||||
// end to end tests
|
||||
|
||||
|
@ -477,7 +481,8 @@ module.exports = {
|
|||
front,
|
||||
back,
|
||||
backOnly,
|
||||
backTestOnly,
|
||||
backendUnitTest,
|
||||
dockerAndBackTest,
|
||||
backTest,
|
||||
e2eOnly,
|
||||
e2e,
|
||||
|
|
Loading…
Reference in New Issue