Skip to content

Commit

Permalink
fix(rest): be less noisy
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Apr 23, 2024
1 parent 61edf12 commit e12bd99
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/REST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,10 @@ export const steps: StepRunner<Record<string, any>>[] = [
storeName: Type.String(),
}),
},
async ({ match: { exp, storeName }, log: { progress }, context }) => {
async ({ match: { exp, storeName }, context }) => {
await currentRequest.match(async ({ body }) => {
const e = jsonata(exp)
const result = await e.evaluate(body)

Check warning on line 99 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value
progress(result)
assert.notEqual(result, undefined)
context[storeName] = result

Check warning on line 101 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value
})
Expand All @@ -110,14 +109,12 @@ export const steps: StepRunner<Record<string, any>>[] = [
exp: Type.Optional(Type.String()),
}),
},
async ({ step, match: { exp }, log: { progress } }) => {
async ({ step, match: { exp } }) => {
const expected = JSON.parse(codeBlockOrThrow(step).code)

Check warning on line 113 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value
await currentRequest.match(async ({ body }) => {
const expected = JSON.parse(codeBlockOrThrow(step).code)
progress(expected)
if (exp !== undefined) {
const e = jsonata(exp)
const result = await e.evaluate(body)

Check warning on line 117 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value
progress(result)
check(result).is(objectMatching(expected))

Check warning on line 118 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe argument of type `any` assigned to a parameter of type `ObjMatch<unknown>`
} else {
check(body).is(objectMatching(expected))

Check warning on line 120 in src/REST.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe argument of type `any` assigned to a parameter of type `ObjMatch<{ [x: string]: ...; }>`
Expand Down

0 comments on commit e12bd99

Please sign in to comment.