Sha256: 620113fa5c9fd29263f42f12f570482466323b9bcf6f0c1f9f79b88825fcc72e

Contents?: true

Size: 1.01 KB

Versions: 27

Compression:

Stored size: 1.01 KB

Contents

/*global QUnit:false*/

import moment from '../moment';
import { defineCommonLocaleTests } from './helpers/common-locale';
import { setupDeprecationHandler, teardownDeprecationHandler } from './helpers/deprecation-handler';
import { test } from './qunit';

export function localeModule (name, lifecycle) {
    QUnit.module('locale:' + name, {
        beforeEach : function () {
            moment.locale(name);
            moment.createFromInputFallback = function (config) {
                throw new Error('input not handled by moment: ' + config._i);
            };
            setupDeprecationHandler(test, moment, 'locale');
            if (lifecycle && lifecycle.setup) {
                lifecycle.setup();
            }
        },
        afterEach : function () {
            moment.locale('en');
            teardownDeprecationHandler(test, moment, 'locale');
            if (lifecycle && lifecycle.teardown) {
                lifecycle.teardown();
            }
        }
    });
    defineCommonLocaleTests(name, -1, -1);
}

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
card-1.100.0 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.6 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.5 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.4 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.3 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.2 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.1 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.99.0 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.98.3 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.98.2 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.98.1 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.98.0 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.97.0.1 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.97.0 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.8 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.7 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.6 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.5 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.4 mod/date/vendor/moment/src/test/qunit-locale.js
card-1.96.3 mod/date/vendor/moment/src/test/qunit-locale.js