Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/server-core/src/core.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { createFeathersExpressApp } from './createApp'
describe('Core', () => {
it('should initialise app', async () => {
const app = createFeathersExpressApp()
assert.doesNotReject(app.setup())
assert.doesNotReject(app.isSetup)
await app.setup()
assert.ok(app.isSetup)
})
after(() => {
return destroyEngine()
Expand Down
6 changes: 3 additions & 3 deletions packages/server-core/src/sequelize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default (app: Application): void => {
promiseReject = reject
})

app.setup = async function (...args: any) {
app.setup = async function (...args) {
try {
await sequelize.query('SET FOREIGN_KEY_CHECKS = 0')

Expand All @@ -47,7 +47,7 @@ export default (app: Application): void => {
if (typeof (sequelizeModel as any).associate === 'function') {
;(sequelizeModel as any).associate(sequelize.models)
}
await sequelizeModel.sync({ force: forceRefresh })
await sequelizeModel.sync({ force: forceRefresh || appConfig.testEnabled })

if (prepareDb) {
const columnResult = await sequelize.query(`DESCRIBE \`${model}\``)
Expand Down Expand Up @@ -82,7 +82,7 @@ export default (app: Application): void => {
const sync = await sequelize.sync()
try {
// configure seeder and seed
await seeder(app, forceRefresh, prepareDb)
await seeder(app, forceRefresh || appConfig.testEnabled, prepareDb)
} catch (err) {
logger.error('Feathers seeding error')
logger.error(err)
Expand Down