This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7df0580
commit 96613d6
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { mwsDate } from '../../src/parsing' | ||
|
||
describe('sellers', () => { | ||
describe('mwsDate', () => { | ||
/** | ||
* Adding this test because for some reason git actions fails on dates | ||
* https://github.com/ScaleLeap/amazon-mws-api-sdk/pull/113/checks?check_run_id=830331398 | ||
*/ | ||
it('parses dates correctly', async () => { | ||
expect.assertions(1) | ||
|
||
const shipDate = '10/16/2018 07:41:12' | ||
const fromSnapshot = '2018-10-15T23:41:12.000Z' // this is the output of the snapshot | ||
// const notFromSnapshot = '2018-10-16T07:41:12.000Z' // the output from the test running in git | ||
const output = mwsDate.decode(shipDate).caseOf({ | ||
Right: (x) => x.toISOString(), | ||
Left: () => { | ||
console.log() | ||
}, | ||
}) | ||
|
||
expect(output).toStrictEqual(fromSnapshot) | ||
}) | ||
}) | ||
}) |