Skip to content

Commit

Permalink
convert test/unit/ms.spec.js to unexpected
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
  • Loading branch information
boneskull committed Apr 21, 2018
1 parent c43c096 commit d4f6515
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/unit/ms.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,51 @@ describe('.ms()', function () {
};
describe('get a value that less than 1 second', function () {
it('should return milliseconds representation', function () {
expect(ms(200)).to.equal('200ms');
expect(ms(30)).to.equal('30ms');
expect(ms(2000)).to.not.equal('2000ms');
expect(ms(200), 'to be', '200ms');
expect(ms(30), 'to be', '30ms');
expect(ms(2000), 'not to be', '2000ms');
});
});

describe('seconds representation', function () {
it('should return short format', function () {
expect(ms(2000)).to.equal('2s');
expect(ms(2000), 'to be', '2s');
});
});

describe('minutes representation', function () {
it('should return short format', function () {
expect(ms(time.minutes(1))).to.equal('1m');
expect(ms(time.minutes(1)), 'to be', '1m');
});
});

describe('hours representation', function () {
it('should return short format', function () {
expect(ms(time.hours(1))).to.equal('1h');
expect(ms(time.hours(1)), 'to be', '1h');
});
});

describe('days representation', function () {
it('should return short format', function () {
expect(ms(time.days(1))).to.equal('1d');
expect(ms(time.days(1)), 'to be', '1d');
});
});

describe('Getting string value', function () {
it('should return the milliseconds representation(Number)', function () {
expect(ms('1 second')).to.equal(1000);
expect(ms('1 second'), 'to be', 1000);

expect(ms('1 minute')).to.equal(time.minutes(1));
expect(ms('6 minutes')).to.equal(time.minutes(6));
expect(ms('1 minute'), 'to be', time.minutes(1));
expect(ms('6 minutes'), 'to be', time.minutes(6));

expect(ms('1 hour')).to.equal(time.hours(1));
expect(ms('5 hours')).to.equal(time.hours(5));
expect(ms('1 hour'), 'to be', time.hours(1));
expect(ms('5 hours'), 'to be', time.hours(5));

expect(ms('1 day')).to.equal(time.days(1));
expect(ms('3 days')).to.equal(time.days(3));
expect(ms('1 day'), 'to be', time.days(1));
expect(ms('3 days'), 'to be', time.days(3));

expect(ms('1 year')).to.equal(time.years(1));
expect(ms('2 years')).to.equal(time.years(2));
expect(ms('1 year'), 'to be', time.years(1));
expect(ms('2 years'), 'to be', time.years(2));
});
});
});

0 comments on commit d4f6515

Please sign in to comment.