Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/todoist-api.tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.content).toBe('* This is an uncompletable task')
return HttpResponse.json(expectedTask, { status: 200 })
}),
Expand All @@ -90,7 +90,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.content).toBe('* Already has prefix')
return HttpResponse.json(expectedTask, { status: 200 })
}),
Expand All @@ -115,7 +115,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.content).toBe('Regular completable task')
return HttpResponse.json(expectedTask, { status: 200 })
}),
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}/123`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.content).toBe('* Updated uncompletable task')
return HttpResponse.json(returnedTask, { status: 200 })
}),
Expand All @@ -191,7 +191,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_REST_TASKS}/123`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.content).toBeUndefined()
expect(body.is_uncompletable).toBe(false) // Note: snake_case conversion
return HttpResponse.json(returnedTask, { status: 200 })
Expand Down Expand Up @@ -286,7 +286,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_SYNC_QUICK_ADD}`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.text).toBe('* Quick uncompletable task')
return HttpResponse.json(expectedTask, { status: 200 })
}),
Expand All @@ -311,7 +311,7 @@ describe('TodoistApi task endpoints', () => {

server.use(
http.post(`${getSyncBaseUri()}${ENDPOINT_SYNC_QUICK_ADD}`, async ({ request }) => {
const body = (await request.json()) as any
const body = (await request.json()) as Record<string, unknown>
expect(body.text).toBe('* Already prefixed quick task')
return HttpResponse.json(expectedTask, { status: 200 })
}),
Expand Down