How to use the @adonisjs/fold.ioc.autoload 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 adonisjs / adonis-framework / test / unit / server.spec.js View on Github external
group.before(() => {
    Context.getter('request', function () {
      return new Request(this.req, this.res, new Config())
    }, true)

    Context.getter('response', function () {
      const config = new Config()
      config.set('app.http.jsonpCallback', 'callback')
      return new Response(this.request, config)
    }, true)

    setupResolver()
    ioc.autoload(path.join(__dirname, 'app'), 'App')
  })
github nrempel / adonis-kue / test / functional / commands.spec.js View on Github external
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'
github adonisjs / adonis-framework / test / integration / setup.js View on Github external
module.exports = function () {
  process.env.ENV_SILENT = true
  ioc.bind('Adonis/Src/Helpers', function () {
    return new Helpers(path.join(__dirname, './'))
  })

  setupResolver()
  ioc.autoload(path.join(__dirname), 'App')

  return new Promise((resolve, reject) => {
    registrar
      .providers(providers)
      .registerAndBoot()
      .then(resolve)
      .catch(reject)
  })
}