7729-devToTest_2430 #2739
|
@ -10,7 +10,7 @@ async function init() {
|
||||||
host: process.env.DB_HOST,
|
host: process.env.DB_HOST,
|
||||||
port: process.env.DB_PORT
|
port: process.env.DB_PORT
|
||||||
});
|
});
|
||||||
|
customBeforeAll();
|
||||||
const bootOptions = {dataSources};
|
const bootOptions = {dataSources};
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
app.boot(bootOptions,
|
app.boot(bootOptions,
|
||||||
|
@ -24,7 +24,16 @@ async function deinit() {
|
||||||
console.log('Stopping backend.');
|
console.log('Stopping backend.');
|
||||||
await app.disconnect();
|
await app.disconnect();
|
||||||
}
|
}
|
||||||
|
function customBeforeAll() {
|
||||||
|
Object.assign(beforeAll, {
|
||||||
|
ctx: {
|
||||||
|
req: {
|
||||||
|
accessToken: {userId: 9},
|
||||||
|
headers: {origin: 'http://localhost'},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init,
|
init,
|
||||||
deinit
|
deinit
|
||||||
|
@ -32,3 +41,4 @@ module.exports = {
|
||||||
|
|
||||||
if (require.main === module)
|
if (require.main === module)
|
||||||
init();
|
init();
|
||||||
|
|
||||||
|
|
|
@ -84,13 +84,12 @@ async function test() {
|
||||||
'loopback/**/*[sS]pec.js',
|
'loopback/**/*[sS]pec.js',
|
||||||
'modules/*/back/**/*.[sS]pec.js'
|
'modules/*/back/**/*.[sS]pec.js'
|
||||||
],
|
],
|
||||||
helpers: []
|
helpers: [`back/tests-helper.js`]
|
||||||
};
|
};
|
||||||
|
|
||||||
if (PARALLEL) {
|
if (PARALLEL) {
|
||||||
const ParallelRunner = require('jasmine/parallel');
|
const ParallelRunner = require('jasmine/parallel');
|
||||||
runner = new ParallelRunner({numWorkers: 1});
|
runner = new ParallelRunner({numWorkers: 1});
|
||||||
config.helpers.push(`back/tests-helper.js`);
|
|
||||||
} else {
|
} else {
|
||||||
const Jasmine = require('jasmine');
|
const Jasmine = require('jasmine');
|
||||||
runner = new Jasmine();
|
runner = new Jasmine();
|
||||||
|
|
Loading…
Reference in New Issue