Skip to content

Commit

Permalink
test: make tests run
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Prodromou <evan@openearth.org>
  • Loading branch information
evanp committed Aug 13, 2023
1 parent d482e5a commit 5e7e4e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "city-catalyst",
"version": "0.0.1",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
8 changes: 6 additions & 2 deletions app/tests/models.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { before, describe, it } from 'node:test';
import { before, after, describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { randomUUID } from 'node:crypto';
import 'dotenv/config';
Expand All @@ -15,6 +15,11 @@ describe('Models', () => {
await db.models.City.destroy({ where: { locode } });
});

after(async () => {
if (db.sequelize)
await db.sequelize.close();
});

describe('User model', () => {
it('should have unique emails', async () => {
const user = await db.models.User.create({ userId: randomUUID(), email });
Expand All @@ -35,4 +40,3 @@ describe('Models', () => {
});
});
});

0 comments on commit 5e7e4e7

Please sign in to comment.