We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4929ad8 commit edb13d4Copy full SHA for edb13d4
website/src/scripts/services/date/date.js
@@ -0,0 +1,7 @@
1
+const _public = {};
2
+
3
+_public.getNow = () => {
4
+ return new Date();
5
+};
6
7
+export default _public;
website/src/scripts/services/date/date.test.js
@@ -0,0 +1,10 @@
+import dateService from './date';
+describe('Date Service', () => {
+ const dateMock = new Date();
+ it('should get now date', () => {
+ window.Date = jest.fn(() => dateMock);
8
+ expect(dateService.getNow()).toEqual(dateMock);
9
+ });
10
+});
0 commit comments