Total Complexity | 2 |
Complexity/F | 0 |
Lines of Code | 20 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {Database, Store} from "../src/Jeloquent"; |
||
2 | |||
3 | import {User, UserAddress, Avatar, Team, Comment} from "./Models"; |
||
4 | |||
5 | test('tables can be added or dropped', () => { |
||
6 | const store = new Store(); |
||
7 | const database = new Database('defaultDb', [Team, User, UserAddress, Avatar, Comment]); |
||
8 | store.add(database); |
||
9 | store.use('defaultDb'); |
||
10 | |||
11 | for (const tableName of store.database().showTables()) { |
||
12 | expect(['Team', 'User', 'UserAddress', 'Avatar', 'Comment']).toContain(tableName); |
||
13 | } |
||
14 | |||
15 | |||
16 | database.drop('User'); |
||
17 | for (const tableName of store.database().showTables()) { |
||
18 | expect(['Team', 'UserAddress', 'Avatar', 'Comment']).toContain(tableName); |
||
19 | } |
||
20 | }); |