How to use the @adonisjs/fold.ioc._aliases 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'))
    assert.isFalse(ioc._bindings['Adonis/Notifications/DatabaseMessage'].singleton)
github enniel / adonis-notifications / test / functional / providers.spec.js View on Github external
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')
  })