Skip to content

Commit dc54a56

Browse files
committed
tests: remove unnecessary timezone-mock
1 parent 8143d34 commit dc54a56

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"after": "0.8.2",
2323
"eslint": "7.32.0",
2424
"seedrandom": "3.0.5",
25-
"timezone-mock": "0.0.7",
2625
"urun": "0.0.8",
2726
"utest": "0.0.8"
2827
},

test/integration/connection/test-timezones.js

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
1-
var timezone_mock = require('timezone-mock');
2-
31
var assert = require('assert');
42
var common = require('../../common');
53

6-
function registerMock() {
7-
timezone_mock.register('US/Pacific');
8-
var date = new Date(Date.now());
9-
var tzo = date.getTimezoneOffset();
10-
assert.ok(tzo === 420 || tzo === 480);
11-
}
12-
134
var table = 'timezone_test';
14-
var pre_statements = ['', 'SET TIME_ZONE="+00:00"', 'SET TIME_ZONE="SYSTEM"', registerMock];
5+
var pre_statements = ['', 'SET TIME_ZONE="+00:00"', 'SET TIME_ZONE="SYSTEM"'];
156
var pre_idx = 0;
167
var test_days = ['01-01', '03-07', '03-08', '03-09', '12-31'].map(function (day) {
17-
// Choosing this because 2015-03-08 02:30 Pacific does not exist (due to DST),
18-
// so if anything is using a local date object it will fail (at least if the
19-
// test system is in Pacific Time).
20-
return '2015-' + day + 'T02:32:11.000Z';
8+
// Choosing this time because it is outsite of standard DST transitions
9+
return '2015-' + day + 'T12:32:11.000Z';
2110
});
2211
var day_idx = 0;
2312
var test_timezones = ['Z', 'local', 0, 1, 5, 12, 23, -1, -5, -20];
@@ -50,11 +39,7 @@ function testNextDate(connection) {
5039
connection.end(assert.ifError);
5140
return;
5241
} else {
53-
if (typeof pre_statements[pre_idx] === 'function') {
54-
pre_statements[pre_idx]();
55-
} else {
56-
connection.query(pre_statements[pre_idx], assert.ifError);
57-
}
42+
connection.query(pre_statements[pre_idx], assert.ifError);
5843
day_idx = tz_idx = 0;
5944
}
6045
}

0 commit comments

Comments
 (0)