How to use the @adonisjs/fold.ioc 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-ignitor / test / ignitor.spec.js View on Github external
}
      setExceptionHandler () {}
    }

    class Ws {
      listen (httpServer) {
        assert.property(httpServer, 'once')
      }
    }

    class BaseHandler {
      handle () {}
      report () {}
    }

    fold.ioc.fake('Adonis/Exceptions/BaseExceptionHandler', () => BaseHandler)
    fold.ioc.fake('Adonis/Addons/Ws', () => new Ws())

    fold.ioc.fake('Adonis/Src/Server', () => new Server())
    fold.ioc.fake('Adonis/Src/Env', () => new Env())

    ignitor.appRoot(path.join(__dirname, './'))
    await ignitor.wsServer().fireHttpServer()
  })
github adonisjs / adonis-ignitor / test / ignitor.spec.js View on Github external
group.beforeEach(() => {
    hooks.before.clear()
    hooks.after.clear()
    fold.ioc._autoloads = {}
    fold.ioc._aliases = {}
    clearRequire(path.join(__dirname, 'start/app.js'))
    clearRequire(path.join(__dirname, 'package.json'))
    fold.ioc.restore()
    fold.ioc.fake('Adonis/Src/Exception', () => {
      return { bind () {} }
    })
    process.removeAllListeners('unhandledRejection')
  })
github adonisjs / adonis-ignitor / test / ignitor.spec.js View on Github external
group.beforeEach(() => {
    hooks.before.clear()
    hooks.after.clear()
    fold.ioc._autoloads = {}
    fold.ioc._aliases = {}
    clearRequire(path.join(__dirname, 'start/app.js'))
    clearRequire(path.join(__dirname, 'package.json'))
    fold.ioc.restore()
    fold.ioc.fake('Adonis/Src/Exception', () => {
      return { bind () {} }
    })
    process.removeAllListeners('unhandledRejection')
  })