|
|
|
@ -1,10 +1,9 @@
|
|
|
|
|
|
|
|
|
|
import express from 'express'; |
|
|
|
|
import nocobuild from '../../../src/nocobuild' |
|
|
|
|
import nocobuild from '../../../src/nocobuild'; |
|
|
|
|
// import { Noco } from '../../../src/lib';
|
|
|
|
|
import { createUser } from '../factory/user'; |
|
|
|
|
import cleanupMeta from './cleanupMeta'; |
|
|
|
|
import { cleanUpSakila, resetAndSeedSakila } from './cleanupSakila'; |
|
|
|
|
import { createUser } from '../factory/user'; |
|
|
|
|
|
|
|
|
|
let server; |
|
|
|
|
|
|
|
|
@ -12,7 +11,7 @@ const serverInit = async () => {
|
|
|
|
|
const serverInstance = express(); |
|
|
|
|
serverInstance.enable('trust proxy'); |
|
|
|
|
// serverInstance.use(await Noco.init());
|
|
|
|
|
await nocobuild(serverInstance) |
|
|
|
|
await nocobuild(serverInstance); |
|
|
|
|
serverInstance.use(function (req, res, next) { |
|
|
|
|
// 50 sec timeout
|
|
|
|
|
req.setTimeout(500000, function () { |
|
|
|
@ -24,7 +23,7 @@ const serverInit = async () => {
|
|
|
|
|
return serverInstance; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const isFirstTimeRun = () => !server |
|
|
|
|
const isFirstTimeRun = () => !server; |
|
|
|
|
|
|
|
|
|
export default async function () { |
|
|
|
|
const { default: TestDbMngr } = await import('../TestDbMngr'); |
|
|
|
@ -39,5 +38,10 @@ export default async function () {
|
|
|
|
|
|
|
|
|
|
const { token } = await createUser({ app: server }, { roles: 'editor' }); |
|
|
|
|
|
|
|
|
|
return { app: server, token, dbConfig: TestDbMngr.dbConfig, sakilaDbConfig: TestDbMngr.getSakilaDbConfig() }; |
|
|
|
|
return { |
|
|
|
|
app: server, |
|
|
|
|
token, |
|
|
|
|
dbConfig: TestDbMngr.dbConfig, |
|
|
|
|
sakilaDbConfig: TestDbMngr.getSakilaDbConfig(), |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|