1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

Respond to Mike's feedback.

This commit is contained in:
Sam Rose 2024-04-04 15:27:50 +01:00
parent b6431e57ff
commit d0a5ae6ae3
No known key found for this signature in database
3 changed files with 12 additions and 8 deletions

View file

@ -54,12 +54,9 @@ const config: Config.InitialOptions = {
"!src/db/views/staticViews.*",
"!src/**/*.spec.{js,ts}",
"!src/tests/**/*.{js,ts}",
// The use of coverage in the JS runner bundles breaks tests
"!src/jsRunner/bundles/**/*.{js,ts}",
// We have a polyfill for the TextDecoder class in here that gets
// injected into the vm for deserializing BSON. If it gets coveraged
// it breaks the tests.
"!src/jsRunner/vm/isolated-vm.ts",
// The use of coverage in the JS runner breaks tests by inserting
// coverage functions into code that will run inside of the isolate.
"!src/jsRunner/**/*.{js,ts}",
],
coverageReporters: ["lcov", "json", "clover"],
}

View file

@ -143,7 +143,7 @@
"jest": "29.7.0",
"jest-openapi": "0.14.2",
"jest-runner": "29.7.0",
"nock": "^13.5.4",
"nock": "13.5.4",
"nodemon": "2.0.15",
"openapi-typescript": "5.2.0",
"path-to-regexp": "6.2.0",

View file

@ -299,7 +299,14 @@ export async function preview(
},
}
const { rows, keys, info, extra } = await Runner.run<QueryResponse>(inputs)
let queryResponse: QueryResponse
try {
queryResponse = await Runner.run<QueryResponse>(inputs)
} catch (err: any) {
ctx.throw(400, err)
}
const { rows, keys, info, extra } = queryResponse
const { previewSchema, nestedSchemaFields } = getSchemaFields(rows, keys)
// if existing schema, update to include any previous schema keys