diff --git a/.changeset/strong-dolphins-work.md b/.changeset/strong-dolphins-work.md new file mode 100644 index 00000000000..bf63ba4d137 --- /dev/null +++ b/.changeset/strong-dolphins-work.md @@ -0,0 +1,5 @@ +--- +'@keystonejs/api-tests': patch +--- + +knex adapter don't spam console output during tests running anymore diff --git a/packages/adapter-knex/lib/adapter-knex.js b/packages/adapter-knex/lib/adapter-knex.js index b1c6abc08c2..431facec5dc 100644 --- a/packages/adapter-knex/lib/adapter-knex.js +++ b/packages/adapter-knex/lib/adapter-knex.js @@ -74,7 +74,9 @@ class KnexAdapter extends BaseKeystoneAdapter { // Run this only if explicity configured and still never in production if (this.config.dropDatabase && process.env.NODE_ENV !== 'production') { - console.log('Knex adapter: Dropping database'); + if (process.env.NODE_ENV !== 'test') { + console.log('Knex adapter: Dropping database'); + } await this.dropDatabase(); } else { return []; @@ -143,7 +145,9 @@ class KnexAdapter extends BaseKeystoneAdapter { // Create an adjacency table for the (many to many) relationship field adapter provided const dbAdapter = this; try { - console.log(`Dropping table ${tableName}`); + if (process.env.NODE_ENV !== 'test') { + console.log(`Dropping table ${tableName}`); + } await dbAdapter.schema().dropTableIfExists(tableName); } catch (err) { console.log('Failed to drop');