Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createTables(ioc.use('Database'))
setupResolver()
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createTables(ioc.use('Adonis/Src/Database'))
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createTables(ioc.use('Adonis/Src/Database'))
})
group.before(() => {
ioc.singleton('Adonis/Src/Config', () => {
let config = new Config()
config.set('queue.driver', 'redis')
config.set('queue.redis.high', {})
config.set('queue.redis.low', {})
config.set('queue.rabbitmq', {})
return config
})
ioc.singleton('Exception', () => {
return {
handlers: {},
reporters: {},
handle (errName, errHandler) {
this.handlers[errName] = errHandler
},
report (errName, errReporter) {
this.reporters[errName] = errReporter
}
}
})
ioc.singleton('Logger', () => {
return new Logger()
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createCollections(ioc.use('Database'))
setupResolver()
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createCollections(ioc.use('Adonis/Src/Database'))
})
ioc.singleton('Adonis/Src/Env', () => new Env())
ioc.alias('Adonis/Src/Env', 'Env')
ioc.singleton('Adonis/Src/Config', function () {
const config = new Config()
config.set('scout', {
driver: 'null',
prefix: '',
null: {}
})
return config
})
ioc.alias('Adonis/Src/Config', 'Config')
ioc.singleton('Adonis/Src/Database', function () {
const config = ioc.use('Config')
config.set('database', {
connection: 'sqlite',
sqlite: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '../../testing.sqlite3')
},
useNullAsDefault: true,
debug: false
}
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createTables(ioc.use('Database'))
setupResolver()
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createCollections(ioc.use('Adonis/Src/Database'))
})
group.before(async () => {
ioc.singleton('Adonis/Src/Database', function () {
const config = new Config()
config.set('database', {
connection: 'testing',
testing: helpers.getConfig()
})
return new DatabaseManager(config)
})
ioc.alias('Adonis/Src/Database', 'Database')
await fs.ensureDir(path.join(__dirname, './tmp'))
await helpers.createTables(ioc.use('Database'))
setupResolver()
})