]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Ignore these tests during DST
authorMatt Johnson <mj1856@hotmail.com>
Sun, 13 Mar 2016 02:40:21 +0000 (18:40 -0800)
committerIskren Chernev <iskren.chernev@gmail.com>
Thu, 24 Mar 2016 10:57:09 +0000 (03:57 -0700)
src/test/helpers/dst.js [new file with mode: 0644]
src/test/moment/zone_switching.js

diff --git a/src/test/helpers/dst.js b/src/test/helpers/dst.js
new file mode 100644 (file)
index 0000000..3bf09ee
--- /dev/null
@@ -0,0 +1,5 @@
+import moment from '../../moment';
+
+export function isNearSpringDST() {
+    return moment().subtract(1, 'day').utcOffset() !== moment().add(1, 'day').utcOffset();
+}
index 7d8460640b4dbd86b9ca5a3a0b5280bfa9c26cc5..d3d66e0f61633e932170b803e7c07cb7d26c6821 100644 (file)
@@ -1,5 +1,6 @@
-import { module, test } from '../qunit';
+import { module, test, expect } from '../qunit';
 import moment from '../../moment';
+import { isNearSpringDST } from '../helpers/dst';
 
 module('zone switching');
 
@@ -45,6 +46,12 @@ test('local to zone, keepLocalTime = false', function (assert) {
 });
 
 test('utc to local, keepLocalTime = true', function (assert) {
+    // Don't test near the spring DST transition
+    if (isNearSpringDST()) {
+        expect(0);
+        return;
+    }
+
     var um = moment.utc(),
         fmt = 'YYYY-DD-MM HH:mm:ss';
 
@@ -58,6 +65,12 @@ test('utc to local, keepLocalTime = false', function (assert) {
 });
 
 test('zone to local, keepLocalTime = true', function (assert) {
+    // Don't test near the spring DST transition
+    if (isNearSpringDST()) {
+        expect(0);
+        return;
+    }
+
     var m = moment(),
         fmt = 'YYYY-DD-MM HH:mm:ss',
         z;