How to use the @adonisjs/fold.registrar.providers 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 ahmadarif / adonis-swagger / test / swagger-provider.spec.js View on Github external
group.before(async () => {
    await registrar.providers([
      path.join(__dirname, '../providers/SwaggerProvider')
    ]).register()

    // call in boot SwaggerProvider
    ace.addCommand('Adonis/Commands/SwaggerExport')
    ace.addCommand('Adonis/Commands/SwaggerExportDocs')
    ace.addCommand('Adonis/Commands/SwaggerRemove')
    ace.addCommand('Adonis/Commands/SwaggerRemoveDocs')
  })
github enniel / adonis-acl / test / functional / providers.spec.js View on Github external
test('CommandsProvider', async (assert) => {
    await registrar
      .providers([path.join(__dirname, '../../providers/CommandsProvider')])
      .registerAndBoot()

    assert.isDefined(ioc.use('Adonis/Commands/Acl:Setup'))
    assert.isFalse(ioc._bindings['Adonis/Commands/Acl:Setup'].singleton)

    assert.isDefined(ioc.use('Adonis/Commands/Acl:Role'))
    assert.isFalse(ioc._bindings['Adonis/Commands/Acl:Role'].singleton)

    assert.isDefined(ioc.use('Adonis/Commands/Acl:Permission'))
    assert.isFalse(ioc._bindings['Adonis/Commands/Acl:Permission'].singleton)
  })
})
github enniel / adonis-notifications / test / functional / providers.spec.js View on Github external
test('CommandsProvider', async (assert) => {
    await registrar
      .providers([path.join(__dirname, '../../providers/CommandsProvider')])
      .registerAndBoot()

    assert.isDefined(ioc.use('Adonis/Commands/Notifications:Setup'))
    assert.isFalse(ioc._bindings['Adonis/Commands/Notifications:Setup'].singleton)
  })
})
github lookinlab / adonis-lucid-filter / test / helpers / setup.js View on Github external
const config = new Config()

      config.set('database', {
        connection: process.env.DB,
        sqlite: {
          client: 'sqlite3',
          connection: {
            filename: path.join(__dirname, 'db.sqlite3')
          }
        }
      })

      return config
    })

    return registrar
      .providers([
        '@adonisjs/lucid/providers/LucidProvider'
      ])
      .registerAndBoot()
      .then(() => {
        const schema = ioc.use('Database').schema

        schema.createTable('users', (table) => {
          table.increments()
          table.string('username').unique()
          table.string('email').unique()
          table.boolean('is_admin').default(false)
          table.string('password')
          table.integer('company_id')
          table.timestamps()
        })
github brainnit / adonisjs-feud / test / functional / feud-provider.spec.js View on Github external
beforeAll(async () => {
  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('feud', {
      tenantColumn: 'tenant_id'
    })
    return config
  })
  ioc.alias('Adonis/Src/Config', 'Config')

  await registrar
    .providers([
      '@adonisjs/lucid/providers/LucidProvider',
      path.join(__dirname, '../../providers/FeudProvider')
    ])
    .registerAndBoot()

  setupResolver()
})
github brainnit / adonisjs-scout / test / functional / search.spec.js View on Github external
},
        options: { apiVersion: '6.4' },
        debug: false
      }
    })

    return config
  })

  ioc.alias('Adonis/Src/Config', 'Config')

  ioc.bind('Adonis/Src/Helpers', () => {
    return new Helpers(path.join(__dirname))
  })

  await registrar
    .providers([
      '@adonisjs/lucid/providers/LucidProvider',
      path.join(__dirname, '../../providers/ScoutProvider')
    ])
    .registerAndBoot()

  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')

  ioc.bind('Adonis/Src/Model', () => Model)
  ioc.alias('Adonis/Src/Model', 'Model')
github adonisjs / adonis-lucid / test / functional / migration-rollback.spec.js View on Github external
ioc.bind('Adonis/Src/Config', () => {
      const config = new Config()
      config.set('database', {
        connection: 'testing',
        testing: helpers.getConfig()
      })
      return config
    })

    ioc.bind('Adonis/Src/Helpers', () => {
      return new Helpers(path.join(__dirname))
    })

    await fs.ensureDir(path.join(__dirname, 'database/migrations'))

    await registrar
      .providers([
        path.join(__dirname, '../../providers/LucidProvider'),
        path.join(__dirname, '../../providers/MigrationsProvider')
      ]).registerAndBoot()

    await fs.ensureDir(path.join(__dirname, '../unit/tmp'))
    await helpers.createTables(ioc.use('Database'))
    setupResolver()
  })
github duyluonglc / lucid-mongo / test / functional / seed-database.spec.js View on Github external
ioc.bind('Adonis/Src/Config', () => {
      const config = new Config()
      config.set('database', {
        connection: 'testing',
        testing: helpers.getConfig()
      })
      return config
    })

    ioc.bind('Adonis/Src/Helpers', () => {
      return new Helpers(path.join(__dirname))
    })

    await fs.ensureDir(path.join(__dirname, 'database/seeds'))

    await registrar
      .providers([
        path.join(__dirname, '../../providers/LucidMongoProvider'),
        path.join(__dirname, '../../providers/MigrationsProvider')
      ]).registerAndBoot()

    await fs.ensureDir(path.join(__dirname, '../unit/tmp'))
    await helpers.createCollections(ioc.use('Database'))
    setupResolver()
  })
github brainnit / adonisjs-scout / test / functional / index-up.spec.js View on Github external
const config = new Config()
    config.set('scout', {
      driver: 'null',
      null: {}
    })
    return config
  })
  ioc.alias('Adonis/Src/Config', 'Config')

  ioc.bind('Adonis/Src/Helpers', () => {
    return new Helpers(path.join(__dirname))
  })

  await fs.ensureDir(path.join(__dirname, 'app/Models/IndexKeepers'))

  await registrar
    .providers([
      path.join(__dirname, '../../providers/ScoutProvider'),
      path.join(__dirname, '../../providers/IndexKeeperProvider')
    ])
    .registerAndBoot()

  setupResolver()
})
github brainnit / adonisjs-scout / test / functional / import.spec.js View on Github external
})
  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()
})