forked from tzuryby/Faker.js
-
Notifications
You must be signed in to change notification settings - Fork 3
/
database_test.ts
43 lines (39 loc) · 1.07 KB
/
database_test.ts
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
43
import { assertEquals, sinon } from "./support/test_deps.ts";
import { faker } from "../mod.ts";
const { test } = Deno;
test({
name: "column() returns a column name",
fn() {
sinon.stub(faker.database, "column").returns("title");
const column = faker.database.column();
assertEquals(column, "title");
faker.database.column.restore();
},
});
test({
name: "collation() returns a collation",
fn() {
sinon.stub(faker.database, "collation").returns("utf8_bin");
const collation = faker.database.collation();
assertEquals(collation, "utf8_bin");
faker.database.collation.restore();
},
});
test({
name: "engine() returns an engine",
fn() {
sinon.stub(faker.database, "engine").returns("InnoDB");
const engine = faker.database.engine();
assertEquals(engine, "InnoDB");
faker.database.engine.restore();
},
});
test({
name: "type() returns a column type",
fn() {
sinon.stub(faker.database, "type").returns("int");
const type = faker.database.type();
assertEquals(type, "int");
faker.database.type.restore();
},
});