Skip to content

Commit

Permalink
fix: update tests to use before and after
Browse files Browse the repository at this point in the history
Per the change in storacha/w3infra#148
  • Loading branch information
travis committed Feb 22, 2023
1 parent 5f0c1b8 commit 8c5a5e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/lib.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ const uploadListResponse = {
insertedAt: '2023-02-13T16:30:22.086Z'
}
],
endCursor: 'bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje',
startCursor: 'bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm'
after: 'bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje',
before: 'bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm'
}

test('uploadListResponseToString can return the upload roots CIDs as strings', (t) => {
Expand Down Expand Up @@ -102,7 +102,7 @@ test('uploadListResponseToString can return the upload roots and shards as a tre
test('uploadListResponseToString can return the response as raw JSON', (t) => {
t.is(
uploadListResponseToString(uploadListResponse, { raw: true }),
'{"size":2,"cursor":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje","results":[{"root":{"/":"bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm"},"shards":[{"/":"bagbaierantza4rfjnhqksp2stcnd2tdjrn3f2kgi2wrvaxmayeuolryi66fq"}],"updatedAt":"2023-02-13T16:29:48.520Z","insertedAt":"2023-02-13T16:27:36.451Z"},{"root":{"/":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje"},"shards":[{"/":"bagbaieraxqbkzwvx5on6an4br5hagfgesdfc6adchy3hf5qt34pupfjd3rbq"}],"updatedAt":"2023-02-13T16:30:22.086Z","insertedAt":"2023-02-13T16:30:22.086Z"}],"endCursor":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje","startCursor":"bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm"}'
'{"size":2,"cursor":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje","results":[{"root":{"/":"bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm"},"shards":[{"/":"bagbaierantza4rfjnhqksp2stcnd2tdjrn3f2kgi2wrvaxmayeuolryi66fq"}],"updatedAt":"2023-02-13T16:29:48.520Z","insertedAt":"2023-02-13T16:27:36.451Z"},{"root":{"/":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje"},"shards":[{"/":"bagbaieraxqbkzwvx5on6an4br5hagfgesdfc6adchy3hf5qt34pupfjd3rbq"}],"updatedAt":"2023-02-13T16:30:22.086Z","insertedAt":"2023-02-13T16:30:22.086Z"}],"after":"bafybeibvbxjeodaa6hdqlgbwmv4qzdp3bxnwdoukay4dpl7aemkiwc2eje","before":"bafybeia7tr4dgyln7zeyyyzmkppkcts6azdssykuluwzmmswysieyadcbm"}'
)
})

Expand All @@ -113,8 +113,8 @@ const storeListResponse = {
{ link: CID.fromJSON({ '/': 'bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma' }), size: 5336, insertedAt: '2023-02-13T10:57:23.274Z' },
{ link: CID.fromJSON({ '/': 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq' }), size: 3297, insertedAt: '2023-02-13T16:30:02.077Z' }
],
endCursor: 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq',
startCursor: 'bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma'
after: 'bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq',
before: 'bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma'
}

test('storeListResponseToString can return the CAR CIDs as strings', (t) => {
Expand All @@ -136,6 +136,6 @@ test('storeListResponseToString can return the CAR CIDs as newline delimited JSO
test('storeListResponseToString can return the response as raw JSON', (t) => {
t.is(
storeListResponseToString(storeListResponse, { raw: true }),
'{"size":2,"cursor":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq","results":[{"link":{"/":"bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma"},"size":5336,"insertedAt":"2023-02-13T10:57:23.274Z"},{"link":{"/":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq"},"size":3297,"insertedAt":"2023-02-13T16:30:02.077Z"}],"endCursor":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq","startCursor":"bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma"}'
'{"size":2,"cursor":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq","results":[{"link":{"/":"bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma"},"size":5336,"insertedAt":"2023-02-13T10:57:23.274Z"},{"link":{"/":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq"},"size":3297,"insertedAt":"2023-02-13T16:30:02.077Z"}],"after":"bagbaieracmkgwrw6rowsk5jse5eihyhszyrq5w23aqosajyckn2tfbotdcqq","before":"bagbaierablvu5d2q5uoimuy2tlc3tcntahnw2j7s7jjaznawc23zgdgcisma"}'
)
})

0 comments on commit 8c5a5e3

Please sign in to comment.