MCPcopy Create free account
hub / github.com/adonisjs/session / createConfigureCommand

Function createConfigureCommand

tests/configure.spec.ts:22–48  ·  view source on GitHub ↗

* Creates the configure command for the package inside a * minimal application scaffolded on the filesystem

(fs: FileSystem, flags: string[] = [])

Source from the content-addressed store, hash-verified

20 * minimal application scaffolded on the filesystem
21 */
22async 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
50test.group('Configure', (group) => {
51 group.each.setup(({ context }) => {

Callers 1

configure.spec.tsFile · 0.85

Calls 2

createMethod · 0.80
bootMethod · 0.80

Tested by

no test coverage detected