Skip to content

Commit

Permalink
test: add checkpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Mar 16, 2024
1 parent dfcc510 commit 610fe55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/helpers/createIntegrationTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const createTestRunner = (PgPool: new (poolConfig: PoolConfig) => PgPoolT
beforeEach(async (t) => {
++testId;

console.log('beforeEach', testId);

Check failure on line 53 in test/helpers/createIntegrationTests.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement

const TEST_DATABASE_NAME = [
'slonik_test',
name,
Expand Down Expand Up @@ -104,6 +106,8 @@ export const createTestRunner = (PgPool: new (poolConfig: PoolConfig) => PgPoolT
});

afterEach(async (t) => {
console.log('afterEach', testId);

Check failure on line 109 in test/helpers/createIntegrationTests.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement

const pool = await createPool('postgresql://' + POSTGRES_DSN, {
maximumPoolSize: 1,
PgPool,
Expand All @@ -122,13 +126,15 @@ export const createTestRunner = (PgPool: new (poolConfig: PoolConfig) => PgPoolT
t.context.testDatabaseName,
])}`);
});
console.log('afterEach clean ok', testId);

Check failure on line 129 in test/helpers/createIntegrationTests.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
} catch (error) {
log.error({
error: serializeError(error),
}, 'could not clean up database');
}

await pool.end();
console.log('afterEach done', testId);

Check failure on line 137 in test/helpers/createIntegrationTests.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
});

return {
Expand Down Expand Up @@ -1073,5 +1079,6 @@ export const createIntegrationTests = (
const error = await t.throwsAsync(pool.query(sql`SELECT * FROM invalid_input_error_test where id = '1';`));

t.true(error instanceof InvalidInputError);
console.log('last test done');

Check failure on line 1082 in test/helpers/createIntegrationTests.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
});
};

0 comments on commit 610fe55

Please sign in to comment.