This repository was archived by the owner on Jan 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.test.ts
More file actions
42 lines (35 loc) · 1.34 KB
/
app.test.ts
File metadata and controls
42 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { useTestDatabase } from './config/index';
const { knex } = require('../helpers');
useTestDatabase();
describe('Test if test database is configured correctly', () => {
test('Users table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('users');
expect(data.length).toBe(2);
});
test('Authors table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('authors');
expect(data.length).toBe(2);
});
test('Categories table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('categories');
expect(data.length).toBe(2);
});
test('Articles table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('articles');
expect(data.length).toBe(2);
});
test('Article Content table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('article_content');
expect(data.length).toBe(2);
});
test('Related Articles table should be filled', async () => {
expect.assertions(1);
const data = await knex.select().table('related_articles');
expect(data.length).toBe(2);
});
});