Sha256: 581a67339ae6edb4b207ffb41512ca55af3095566aaf1e773d69a8b5526af1fc

Contents?: true

Size: 1.08 KB

Versions: 46

Compression:

Stored size: 1.08 KB

Contents

import { module, test } from '../qunit';
import moment from '../../moment';

module('mutable');

test('manipulation methods', function (assert) {
    var m = moment();

    assert.equal(m, m.year(2011), 'year() should be mutable');
    assert.equal(m, m.month(1), 'month() should be mutable');
    assert.equal(m, m.hours(7), 'hours() should be mutable');
    assert.equal(m, m.minutes(33), 'minutes() should be mutable');
    assert.equal(m, m.seconds(44), 'seconds() should be mutable');
    assert.equal(m, m.milliseconds(55), 'milliseconds() should be mutable');
    assert.equal(m, m.day(2), 'day() should be mutable');
    assert.equal(m, m.startOf('week'), 'startOf() should be mutable');
    assert.equal(m, m.add(1, 'days'), 'add() should be mutable');
    assert.equal(m, m.subtract(2, 'years'), 'subtract() should be mutable');
    assert.equal(m, m.local(), 'local() should be mutable');
    assert.equal(m, m.utc(), 'utc() should be mutable');
});

test('non mutable methods', function (assert) {
    var m = moment();
    assert.notEqual(m, m.clone(), 'clone() should not be mutable');
});

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.15.0 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.14.2 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.14.1 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.14.0 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.13.4 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.13.3 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.13.2 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.13.1 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.13.0 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.7 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.12.0 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.6 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.5 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.4 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.3 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.2 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.1 vendor/moment/src/test/moment/mutable.js
card-mod-date-0.11.0 vendor/moment/src/test/moment/mutable.js
card-1.100.0 mod/date/vendor/moment/src/test/moment/mutable.js