Skip to content

Commit

Permalink
Add tests for the Duration class
Browse files Browse the repository at this point in the history
  • Loading branch information
negativetwelve committed Sep 2, 2017
1 parent 71670f4 commit ed6d4b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/handy-duration/src/__tests__/Duration.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Imports
import Duration from '../Duration';


/* eslint-disable no-undef */
describe('Duration', () => {
context('with seconds only', () => {
set('duration', () => new Duration({seconds}));

context('with undefined', () => {
set('seconds', () => undefined);

subject(() => duration);
its('toSeconds', () => isExpected.toBe(0));
its('toSecondsText', () => isExpected.toBe('0 sec'));
its('toMinutes', () => isExpected.toBe(0));
its('toMinutesText', () => isExpected.toBe('0 min'));
});
});
});

0 comments on commit ed6d4b4

Please sign in to comment.