* Creates the configure command for the package inside a * minimal application scaffolded on the filesystem
(fs: FileSystem, flags: string[] = [])
| 20 | * minimal application scaffolded on the filesystem |
| 21 | */ |
| 22 | async function createConfigureCommand(fs: FileSystem, flags: string[] = []) { |
| 23 | const ignitor = new IgnitorFactory() |
| 24 | .withCoreProviders() |
| 25 | .withCoreConfig() |
| 26 | .create(BASE_URL, { |
| 27 | importer: (filePath) => { |
| 28 | if (filePath.startsWith('./') || filePath.startsWith('../')) { |
| 29 | return import(new URL(filePath, BASE_URL).href) |
| 30 | } |
| 31 | |
| 32 | return import(filePath) |
| 33 | }, |
| 34 | }) |
| 35 | |
| 36 | await fs.create('.env', '') |
| 37 | await fs.createJson('tsconfig.json', {}) |
| 38 | await fs.create('start/env.ts', `export default Env.create(new URL('./'), {})`) |
| 39 | await fs.create('start/kernel.ts', `router.use([])`) |
| 40 | await fs.create('adonisrc.ts', `export default defineConfig({}) {}`) |
| 41 | |
| 42 | const app = ignitor.createApp('web') |
| 43 | await app.init() |
| 44 | await app.boot() |
| 45 | |
| 46 | const ace = await app.container.make('ace') |
| 47 | return ace.create(Configure, ['../../index.js', ...flags]) |
| 48 | } |
| 49 | |
| 50 | test.group('Configure', (group) => { |
| 51 | group.each.setup(({ context }) => { |
no test coverage detected