-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdatatypes_test.js
More file actions
58 lines (47 loc) · 1.39 KB
/
datatypes_test.js
File metadata and controls
58 lines (47 loc) · 1.39 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* global describe, it */
var Sequelize = require('sequelize'),
sequelize = require('./environment'),
assert = require('assert');
describe('should support sequelize DataTypes', function () {
'use strict';
var Foo = sequelize.define('Foo', {
title: Sequelize.STRING,
string: Sequelize.STRING,
text: Sequelize.TEXT,
bool: Sequelize.BOOLEAN,
num: Sequelize.INTEGER,
bignum: Sequelize.BIGINT,
float: Sequelize.FLOAT,
date: Sequelize.DATE,
});
describe('DataTypes support', function () {
it('STRING', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.string, 'string');
});
it('BOOLEAN', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.bool, 'boolean');
});
it('INTEGER', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.num, 'number');
});
it('DATE', function () {
var fixture = Foo.fixtures();
assert.ok(fixture.date instanceof Date);
});
it('TEXT', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.text, 'string');
});
it('BIGINT', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.bignum, 'number');
});
it('FLOAT', function () {
var fixture = Foo.fixtures();
assert.equal(typeof fixture.float, 'number');
});
});
});