Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

deleteAll.test.ts 639 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  1. import { runDbMigrations } from '../../src/migrate';
  2. import Eval from '../../src/models/eval';
  3. import { deleteAllEvals } from '../../src/util/database';
  4. import EvalFactory from '../factories/evalFactory';
  5. describe('delete all evals', () => {
  6. beforeAll(async () => {
  7. await runDbMigrations();
  8. });
  9. it('should delete all evals', async () => {
  10. await EvalFactory.create();
  11. await EvalFactory.create();
  12. await EvalFactory.create();
  13. const evals = await Eval.getMany();
  14. expect(evals).toHaveLength(3);
  15. await deleteAllEvals();
  16. const evals2 = await Eval.getMany();
  17. expect(evals2).toHaveLength(0);
  18. });
  19. });
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...