Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
port: 6379,
db: 0,
keyPrefix: 'q'
}
})
config.set('app', {
logger: {
transport: 'console',
console: {
driver: 'console'
}
}
})
return config
})
ioc.alias('Adonis/Src/Config', 'Config')
await registrar.boot()
})
ioc.singleton('Adonis/Src/Event', app => {
const Event = require('@adonisjs/framework/src/Event')
return new Event(app.use('Config'))
})
ioc.alias('Adonis/Src/Event', 'Event')
ioc.bind('Adonis/Notifications/DatabaseNotification', () => {
const DatabaseNotification = require('../../src/DatabaseNotification')
DatabaseNotification._bootIfNotBooted()
return DatabaseNotification
})
ioc.alias('Adonis/Notifications/DatabaseNotification', 'DatabaseNotification')
ioc.bind('Adonis/Notifications/Notifiable', () => {
const Notifiable = require('../../src/Notifiable')
return new Notifiable()
})
ioc.alias('Adonis/Notifications/Notifiable', 'Notifiable')
ioc.bind('Adonis/Notifications/HasDatabaseNotifications', () => {
const HasDatabaseNotifications = require('../../src/HasDatabaseNotifications')
return new HasDatabaseNotifications()
})
ioc.alias('Adonis/Notifications/HasDatabaseNotifications', 'HasDatabaseNotifications')
await fs.ensureDir(path.join(__dirname, '../tmp'))
const Database = use('Database')
await fixtures.up(Database)
setupResolver()
})
return config
})
ioc.alias('Adonis/Src/Config', 'Config')
ioc.bind('Adonis/Src/Helpers', () => {
return new Helpers(path.join(__dirname))
})
const eventMock = jest.fn()
eventMock.on = jest.fn()
eventMock.emit = jest.fn()
eventMock.removeListener = jest.fn()
ioc.bind('Adonis/Src/Event', () => eventMock)
ioc.alias('Adonis/Src/Event', 'Event')
await registrar
.providers([
'@adonisjs/lucid/providers/LucidProvider',
path.join(__dirname, '../../providers/ScoutProvider'),
path.join(__dirname, '../../providers/IndexKeeperProvider')
])
.registerAndBoot()
await fs.ensureDir(path.join(__dirname, '../tmp'))
await fs.ensureDir(path.join(__dirname, 'app/Models'))
await setup.setupTables(ioc.use('Database'))
setupResolver()
})
beforeAll(() => {
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', require('../../config'))
return config
})
ioc.alias('Adonis/Src/Config', 'Config')
const provider = new ScoutProvider(ioc)
provider.register()
setupResolver()
})
beforeAll(() => {
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', require('../../config'))
return config
})
ioc.alias('Adonis/Src/Config', 'Config')
const provider = new ScoutProvider(ioc)
provider.register()
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.bind('Adonis/Notifications/DatabaseNotification', () => {
const DatabaseNotification = require('../../src/DatabaseNotification')
DatabaseNotification._bootIfNotBooted()
return DatabaseNotification
})
ioc.alias('Adonis/Notifications/DatabaseNotification', 'DatabaseNotification')
ioc.bind('Adonis/Notifications/Notifiable', () => {
const Notifiable = require('../../src/Notifiable')
return new Notifiable()
})
ioc.alias('Adonis/Notifications/Notifiable', 'Notifiable')
ioc.bind('Adonis/Notifications/HasDatabaseNotifications', () => {
const HasDatabaseNotifications = require('../../src/HasDatabaseNotifications')
return new HasDatabaseNotifications()
})
ioc.alias('Adonis/Notifications/HasDatabaseNotifications', 'HasDatabaseNotifications')
await fs.ensureDir(path.join(__dirname, '../tmp'))
const Database = use('Database')
await fixtures.up(Database)
setupResolver()
})
group.before(async () => {
resolver.appNamespace('App')
ioc.autoload(path.join(__dirname, './app'), 'App')
registrar
.providers([
'@adonisjs/framework/providers/AppProvider',
'@adonisjs/redis/providers/RedisProvider',
path.join(__dirname, '../../providers/KueProvider'),
path.join(__dirname, '../../providers/CommandsProvider')
])
.register()
ioc.bind('Adonis/Src/Helpers', () => {
return new Helpers(__dirname)
})
ioc.alias('Adonis/Src/Helpers', 'Helpers')
ioc.bind('Adonis/Src/Config', () => {
const config = new Config()
config.set('kue', {
connection: 'kue'
})
config.set('redis', {
connection: 'local',
local: {
host: '127.0.0.1',
port: 6379,
db: 0,
keyPrefix: ''
},
kue: {
host: '127.0.0.1',
port: 6379,
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('Adonis/Src/Database'))
})