7729-devToTest_2430 #2739

Merged
alexm merged 339 commits from 7729-devToTest_2430 into test 2024-07-16 07:11:37 +00:00
2 changed files with 13 additions and 4 deletions
Showing only changes of commit a5d262671d - Show all commits

View File

@ -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();

View File

@ -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();