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-1.96.1 mod/date/vendor/moment/src/test/moment/mutable.js
card-1.96.0 mod/date/vendor/moment/src/test/moment/mutable.js
card-1.95.3 mod/date/vendor/moment/src/test/moment/mutable.js
card-1.95.2 mod/date/vendor/moment/src/test/moment/mutable.js
card-1.95.1 mod/date/vendor/moment/src/test/moment/mutable.js
card-1.95.0 mod/date/vendor/moment/src/test/moment/mutable.js