Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('NotificationsProvider', async (assert) => {
await registrar
.providers([path.join(__dirname, '../../providers/NotificationsProvider')])
.registerAndBoot()
assert.isDefined(ioc.use('Adonis/Notifications/Manager'))
assert.isTrue(ioc._bindings['Adonis/Notifications/Manager'].singleton)
assert.equal(ioc._aliases['Notifications'], 'Adonis/Notifications/Manager')
assert.isDefined(ioc.use('Adonis/Notifications/Notifiable'))
assert.isFalse(ioc._bindings['Adonis/Notifications/Notifiable'].singleton)
assert.equal(ioc._aliases['Notifiable'], 'Adonis/Notifications/Notifiable')
assert.isDefined(ioc.use('Adonis/Notifications/HasDatabaseNotifications'))
assert.isFalse(ioc._bindings['Adonis/Notifications/HasDatabaseNotifications'].singleton)
assert.equal(ioc._aliases['HasDatabaseNotifications'], 'Adonis/Notifications/HasDatabaseNotifications')
assert.isDefined(ioc.use('Adonis/Notifications/DatabaseNotification'))
assert.isFalse(ioc._bindings['Adonis/Notifications/DatabaseNotification'].singleton)
assert.equal(ioc._aliases['DatabaseNotification'], 'Adonis/Notifications/DatabaseNotification')
assert.isTrue(ioc.use('Adonis/Notifications/DatabaseNotification').$booted)
assert.isDefined(ioc.use('Adonis/Notifications/DatabaseMessage'))
test('AclProvider', async (assert) => {
await registrar
.providers([path.join(__dirname, '../../providers/AclProvider')])
.registerAndBoot()
assert.isDefined(ioc.use('Adonis/Acl/Role'))
assert.isFalse(ioc._bindings['Adonis/Acl/Role'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Permission'))
assert.isFalse(ioc._bindings['Adonis/Acl/Permission'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/HasRole'))
assert.isFalse(ioc._bindings['Adonis/Acl/HasRole'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/HasPermission'))
assert.isFalse(ioc._bindings['Adonis/Acl/HasPermission'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Init'))
assert.isFalse(ioc._bindings['Adonis/Acl/Init'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Scope'))
assert.isFalse(ioc._bindings['Adonis/Acl/Scope'].singleton)
test('NotificationsProvider', async (assert) => {
await registrar
.providers([path.join(__dirname, '../../providers/NotificationsProvider')])
.registerAndBoot()
assert.isDefined(ioc.use('Adonis/Notifications/Manager'))
assert.isTrue(ioc._bindings['Adonis/Notifications/Manager'].singleton)
assert.equal(ioc._aliases['Notifications'], 'Adonis/Notifications/Manager')
assert.isDefined(ioc.use('Adonis/Notifications/Notifiable'))
assert.isFalse(ioc._bindings['Adonis/Notifications/Notifiable'].singleton)
assert.equal(ioc._aliases['Notifiable'], 'Adonis/Notifications/Notifiable')
assert.isDefined(ioc.use('Adonis/Notifications/HasDatabaseNotifications'))
assert.isFalse(ioc._bindings['Adonis/Notifications/HasDatabaseNotifications'].singleton)
assert.equal(ioc._aliases['HasDatabaseNotifications'], 'Adonis/Notifications/HasDatabaseNotifications')
assert.isDefined(ioc.use('Adonis/Notifications/DatabaseNotification'))
assert.isFalse(ioc._bindings['Adonis/Notifications/DatabaseNotification'].singleton)
assert.equal(ioc._aliases['DatabaseNotification'], 'Adonis/Notifications/DatabaseNotification')
assert.isTrue(ioc.use('Adonis/Notifications/DatabaseNotification').$booted)
assert.isDefined(ioc.use('Adonis/Notifications/DatabaseMessage'))
assert.isFalse(ioc._bindings['Adonis/Notifications/DatabaseMessage'].singleton)
assert.equal(ioc._aliases['DatabaseMessage'], 'Adonis/Notifications/DatabaseMessage')
})
test('KueProvider', async assert => {
assert.isDefined(ioc.use('Adonis/Addons/Kue'))
assert.isTrue(ioc._bindings['Adonis/Addons/Kue'].singleton)
})
test('register migrations provider', async (assert) => {
await registrar
.providers([path.join(__dirname, '../../providers/MigrationsProvider')])
.registerAndBoot()
assert.isDefined(ioc.use('Adonis/Src/Schema'))
assert.isFalse(ioc._bindings['Adonis/Src/Schema'].singleton)
assert.isDefined(ioc.use('Adonis/Src/Factory'))
assert.isFalse(ioc._bindings['Adonis/Src/Factory'].singleton)
assert.isDefined(ioc.use('Adonis/Src/Migration'))
assert.isTrue(ioc._bindings['Adonis/Src/Migration'].singleton)
})
})
test('CommandsProvider', async assert => {
assert.isDefined(ioc.use('Adonis/Commands/Kue:Listen'))
assert.isFalse(ioc._bindings['Adonis/Commands/Kue:Listen'].singleton)
})
})
test('register lucid provider and access query builder', async (assert) => {
await registrar
.providers([path.join(__dirname, '../../providers/LucidMongoProvider')])
.registerAndBoot()
assert.isDefined(ioc.use('Adonis/Src/Database'))
assert.isTrue(ioc._bindings['Adonis/Src/Database'].singleton)
assert.isDefined(ioc.use('Adonis/Src/Model'))
assert.isFalse(ioc._bindings['Adonis/Src/Model'].singleton)
assert.isDefined(ioc.use('Database'))
assert.isDefined(ioc.use('Model'))
})
assert.isFalse(ioc._bindings['Adonis/Acl/Permission'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/HasRole'))
assert.isFalse(ioc._bindings['Adonis/Acl/HasRole'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/HasPermission'))
assert.isFalse(ioc._bindings['Adonis/Acl/HasPermission'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Init'))
assert.isFalse(ioc._bindings['Adonis/Acl/Init'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Scope'))
assert.isFalse(ioc._bindings['Adonis/Acl/Scope'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Is'))
assert.isFalse(ioc._bindings['Adonis/Acl/Is'].singleton)
assert.isDefined(ioc.use('Adonis/Acl/Can'))
assert.isFalse(ioc._bindings['Adonis/Acl/Can'].singleton)
})