DEV Community

Discussion on: Tests with Jest and TypeORM

sadra profile image
Sadra Isapanah Amlashi • Edited on

Can you put your example here please?

samrith profile image
Samrith Shankar

Here you go:

const entityDeletionPromises = => async() => {
  const repository = connection.getRepository(;
  await repository.query(`DELETE FROM ${entity.tableName}`);
await Promise.all(entityDeletionPromises);
Enter fullscreen mode Exit fullscreen mode
Thread Thread
jackbilestech profile image
jack-biles-technology • Edited on

I'm currently using typeorm 0.2.31 and they allow for repo.clear() to truncate / drop the table