Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Jul 31, 2024
1 parent 1f83f85 commit d3ce185
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions packages/core/src/__tests__/recon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ describe('ReconApi', () => {
const fakeInterest1 = TestUtils.randomStreamID()
await reconApi.init('testInitialCursor', [fakeInterest0, fakeInterest1])
expect(mockSendRequest).toHaveBeenCalledTimes(4)
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: fakeInterest0.toString() }, headers: { 'Content-Type': 'application/json' } }
)
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: fakeInterest1.toString() }, headers: { 'Content-Type': 'application/json' } }
)
expect(mockSendRequest).toHaveBeenCalledWith(`${RECON_URL}/ceramic/interests`, {
method: 'POST',
body: { sep: 'model', sepValue: fakeInterest0.toString() },
headers: { 'Content-Type': 'application/json' },
})
expect(mockSendRequest).toHaveBeenCalledWith(`${RECON_URL}/ceramic/interests`, {
method: 'POST',
body: { sep: 'model', sepValue: fakeInterest1.toString() },
headers: { 'Content-Type': 'application/json' },
})
reconApi.stop()
})
})
Expand All @@ -120,10 +122,11 @@ describe('ReconApi', () => {

test('should be able to register interest in a model', async () => {
await reconApi.registerInterest(MODEL)
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: MODEL.toString() }, headers: { 'Content-Type': 'application/json' } }
)
expect(mockSendRequest).toHaveBeenCalledWith(`${RECON_URL}/ceramic/interests`, {
method: 'POST',
body: { sep: 'model', sepValue: MODEL.toString() },
headers: { 'Content-Type': 'application/json' },
})
})
})

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/recon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export class ReconApi extends Observable<ReconEventFeedResponse> implements IRec
}
try {
const headers = { 'Content-Type': 'application/json' }
const body = { sep: "model", sepValue: model.toString(), ...(controller && { controller }) }
const body = { sep: 'model', sepValue: model.toString(), ...(controller && { controller }) }
await this.#sendRequest(this.#url + `/ceramic/interests`, {
method: 'POST',
headers,
Expand Down

0 comments on commit d3ce185

Please sign in to comment.