Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix: test structure
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jul 2, 2020
1 parent 96613d6 commit 16ba997
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions test/unit/codec.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
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)
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)
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)
})
})

0 comments on commit 16ba997

Please sign in to comment.