Fix jest filters.

This commit is contained in:
Sam Rose 2024-11-06 17:52:15 +00:00
parent 42a0e26aed
commit b9f2c38aca
No known key found for this signature in database
6 changed files with 28 additions and 36 deletions

View File

@ -0,0 +1,9 @@
const { isDatasourceTest } = require(".")
module.exports = paths => {
return {
filtered: paths
.filter(path => isDatasourceTest(path))
.map(path => ({ test: path })),
}
}

View File

@ -1,9 +0,0 @@
import { DATASOURCE_TEST_FILES } from "."
export default (paths: string[]) => {
return {
filtered: paths
.filter(path => DATASOURCE_TEST_FILES.includes(path))
.map(path => ({ test: path })),
}
}

View File

@ -0,0 +1,10 @@
const fs = require("fs")
function isDatasourceTest(path) {
const content = fs.readFileSync(path, "utf8")
return content.includes("datasourceDescribe(")
}
module.exports = {
isDatasourceTest,
}

View File

@ -1,18 +0,0 @@
// Generated with:
// cd packages/server
// rg -l "datasourceDescribe" --glob "*.spec.ts"
export const DATASOURCE_TEST_FILES = [
"src/automations/tests/executeQuery.spec.ts",
"src/integration-test/mysql.spec.ts",
"src/integration-test/postgres.spec.ts",
"src/api/routes/tests/rowAction.spec.ts",
"src/automations/tests/scenarios/scenarios.spec.ts",
"src/api/routes/tests/queries/generic-sql.spec.ts",
"src/api/routes/tests/table.spec.ts",
"src/api/routes/tests/queries/mongodb.spec.ts",
"src/api/routes/tests/datasource.spec.ts",
"src/api/routes/tests/viewV2.spec.ts",
"src/api/routes/tests/row.spec.ts",
"src/api/routes/tests/search.spec.ts",
"src/sdk/app/rows/search/tests/search.spec.ts",
]

View File

@ -0,0 +1,9 @@
const { isDatasourceTest } = require(".")
module.exports = paths => {
return {
filtered: paths
.filter(path => !isDatasourceTest(path))
.map(path => ({ test: path })),
}
}

View File

@ -1,9 +0,0 @@
import { DATASOURCE_TEST_FILES } from "."
export default (paths: string[]) => {
return {
filtered: paths
.filter(path => !DATASOURCE_TEST_FILES.includes(path))
.map(path => ({ test: path })),
}
}