Skip to content

Commit

Permalink
Remove adapters output from tests (#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbarcovsky authored Jan 28, 2020
1 parent 8415f62 commit 0da2ce9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-dolphins-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystonejs/api-tests': patch
---

knex adapter don't spam console output during tests running anymore
8 changes: 6 additions & 2 deletions packages/adapter-knex/lib/adapter-knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 0da2ce9

Please sign in to comment.