From ae35d24eafdaaefaa66307cf21360184631454a8 Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Tue, 26 Dec 2023 11:46:05 +0530 Subject: [PATCH] test: fix breaking tests --- index.ts | 1 - package.json | 2 +- test/configure.spec.ts | 20 ++++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/index.ts b/index.ts index 4d39b223..861b08d3 100644 --- a/index.ts +++ b/index.ts @@ -9,5 +9,4 @@ export * as errors from './src/errors.js' export { configure } from './configure.js' -export { stubsRoot } from './stubs/main.js' export { defineConfig } from './src/define_config.js' diff --git a/package.json b/package.json index 165cd50e..b94dfa17 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "index:commands": "adonis-kit index build/commands" }, "dependencies": { - "@adonisjs/presets": "^1.0.0", + "@adonisjs/presets": "^1.0.2", "@faker-js/faker": "^8.3.1", "@poppinss/hooks": "^7.2.2", "@poppinss/macroable": "^1.0.1", diff --git a/test/configure.spec.ts b/test/configure.spec.ts index 65e6880a..6e87e914 100644 --- a/test/configure.spec.ts +++ b/test/configure.spec.ts @@ -20,6 +20,8 @@ test.group('Configure', (group) => { context.fs.basePath = fileURLToPath(BASE_URL) }) + group.each.disableTimeout() + test('create config file and register provider', async ({ fs, assert }) => { const ignitor = new IgnitorFactory() .withCoreProviders() @@ -45,7 +47,9 @@ test.group('Configure', (group) => { const ace = await app.container.make('ace') ace.prompt.trap('Select the database you want to use').chooseOption(2) - ace.prompt.trap('Do you want to install npm package "pg"?').reject() + ace.prompt + .trap('Do you want to install additional packages required by "@adonisjs/lucid"?') + .reject() const command = await ace.create(Configure, ['../../index.js']) await command.exec() @@ -67,7 +71,7 @@ test.group('Configure', (group) => { await assert.fileContains('start/env.ts', 'DB_USER: Env.schema.string()') await assert.fileContains('start/env.ts', 'DB_PASSWORD: Env.schema.string.optional()') await assert.fileContains('start/env.ts', 'DB_DATABASE: Env.schema.string()') - }).timeout(6000) + }) test('do not define env vars for sqlite dialect', async ({ fs, assert }) => { const ignitor = new IgnitorFactory() @@ -92,7 +96,7 @@ test.group('Configure', (group) => { const ace = await app.container.make('ace') ace.prompt.trap('Select the database you want to use').chooseOption(0) - ace.prompt.trap('Do you want to install npm package "sqlite3"?').reject() + ace.prompt.trap('Do you want to install additional packages required by "@adonisjs/lucid"?') const command = await ace.create(Configure, ['../../index.js']) await command.exec() @@ -104,7 +108,7 @@ test.group('Configure', (group) => { await assert.fileNotExists('.env') await assert.fileNotExists('start/env.ts') - }).timeout(6000) + }) test('create tmp directory for sqlite dialect', async ({ fs, assert }) => { const ignitor = new IgnitorFactory() @@ -129,13 +133,13 @@ test.group('Configure', (group) => { const ace = await app.container.make('ace') ace.prompt.trap('Select the database you want to use').chooseOption(0) - ace.prompt.trap('Do you want to install npm package "sqlite3"?').reject() + ace.prompt.trap('Do you want to install additional packages required by "@adonisjs/lucid"?') const command = await ace.create(Configure, ['../../index.js']) await command.exec() await assert.dirExists('tmp') - }).timeout(6000) + }) test('do not recreate tmp directory if it already exists', async ({ fs, assert }) => { const ignitor = new IgnitorFactory() @@ -161,11 +165,11 @@ test.group('Configure', (group) => { const ace = await app.container.make('ace') ace.prompt.trap('Select the database you want to use').chooseOption(0) - ace.prompt.trap('Do you want to install npm package "sqlite3"?').reject() + ace.prompt.trap('Do you want to install additional packages required by "@adonisjs/lucid"?') const command = await ace.create(Configure, ['../../index.js']) await command.exec() await assert.fileExists('tmp/db.sqlite') - }).timeout(6000) + }) })