-
Notifications
You must be signed in to change notification settings - Fork 33
/
test.js
29 lines (27 loc) · 1.05 KB
/
test.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
var expect = require('chai').expect;
var jstz = require('./');
/**
* TODO: It would be ideal to utilize the python tests within
* ./utilities/dst.py. We aren't yet actually testing any functionality, just
* API shape.
*/
describe('API', function() {
it('Should have a "determine" method.', function () {
expect(jstz).to.respondTo('determine');
});
it('Timezone instance has a name method that returns a string', function() {
var timezone = jstz.determine();
expect(timezone).to.respondTo('name');
expect(timezone.name()).to.be.a('string');
});
it('Timezone instance has an stdTimezoneOffset method that returns a number', function() {
var timezone = jstz.determine();
expect(timezone).to.respondTo('stdTimezoneOffset');
expect(timezone.stdTimezoneOffset()).to.be.a('number');
});
it('Timezone instance has a timezoneOffset method that returns a number', function() {
var timezone = jstz.determine();
expect(timezone).to.respondTo('timezoneOffset');
expect(timezone.timezoneOffset()).to.be.a('number');
});
});