How to use the @adonisjs/fold.ioc._bindings function in @adonisjs/fold

To help you get started, we’ve selected a few @adonisjs/fold examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enniel / adonis-notifications / test / functional / providers.spec.js View on Github external
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'))
github enniel / adonis-acl / test / functional / providers.spec.js View on Github external
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)
github enniel / adonis-notifications / test / functional / providers.spec.js View on Github external
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')
  })
github nrempel / adonis-kue / test / functional / providers.spec.js View on Github external
test('KueProvider', async assert => {
    assert.isDefined(ioc.use('Adonis/Addons/Kue'))
    assert.isTrue(ioc._bindings['Adonis/Addons/Kue'].singleton)
  })
github duyluonglc / lucid-mongo / test / functional / providers.spec.js View on Github external
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)
  })
})
github nrempel / adonis-kue / test / functional / providers.spec.js View on Github external
test('CommandsProvider', async assert => {
    assert.isDefined(ioc.use('Adonis/Commands/Kue:Listen'))
    assert.isFalse(ioc._bindings['Adonis/Commands/Kue:Listen'].singleton)
  })
})
github duyluonglc / lucid-mongo / test / functional / providers.spec.js View on Github external
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'))
  })
github enniel / adonis-acl / test / functional / providers.spec.js View on Github external
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)
  })