Skip to content

Commit

Permalink
Adding parse method to complete API (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
scalvert authored Mar 29, 2019
1 parent 065c08e commit 0ceddc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addon/services/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ export default Service.extend({
UTC(...args) {
return new Date(Date.UTC(...args));
},

parse(dateString) {
return Date.parse(dateString);
},
});
6 changes: 6 additions & 0 deletions tests/unit/fake-date-service-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ module('Unit | Service | fake date', function(hooks) {
this.fakeService = FakeDateService.create();
});

test('it has the static Date APIs', function(assert) {
assert.equal(typeof this.fakeService.now, 'function');
assert.equal(typeof this.fakeService.UTC, 'function');
assert.equal(typeof this.fakeService.parse, 'function');
});

test('it returns a date from the now method', function(assert) {
assert.ok(this.fakeService.now());
});
Expand Down

0 comments on commit 0ceddc2

Please sign in to comment.