forked from zuriby/Faker.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.unit.js
47 lines (39 loc) · 1.42 KB
/
database.unit.js
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
44
45
46
47
if (typeof module !== 'undefined') {
var assert = require('assert');
var sinon = require('sinon');
var faker = require('../index');
}
describe("database.js", function () {
describe("column()", function () {
it("returns a column name", function () {
sinon.stub(faker.database, 'column').returns('title');
var column = faker.database.column();
assert.equal(column, 'title');
faker.database.column.restore();
});
});
describe("collation()", function () {
it("returns a collation", function () {
sinon.stub(faker.database, 'collation').returns('utf8_bin');
var collation = faker.database.collation();
assert.equal(collation, 'utf8_bin');
faker.database.collation.restore();
});
});
describe("engine()", function () {
it("returns an engine", function () {
sinon.stub(faker.database, 'engine').returns('InnoDB');
var engine = faker.database.engine();
assert.equal(engine, 'InnoDB');
faker.database.engine.restore();
});
});
describe("type()", function () {
it("returns a column type", function () {
sinon.stub(faker.database, 'type').returns('int');
var type = faker.database.type();
assert.equal(type, 'int');
faker.database.type.restore();
});
});
});