Fix jest filters.
This commit is contained in:
parent
42a0e26aed
commit
b9f2c38aca
|
@ -0,0 +1,9 @@
|
|||
const { isDatasourceTest } = require(".")
|
||||
|
||||
module.exports = paths => {
|
||||
return {
|
||||
filtered: paths
|
||||
.filter(path => isDatasourceTest(path))
|
||||
.map(path => ({ test: path })),
|
||||
}
|
||||
}
|
|
@ -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 })),
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
const fs = require("fs")
|
||||
|
||||
function isDatasourceTest(path) {
|
||||
const content = fs.readFileSync(path, "utf8")
|
||||
return content.includes("datasourceDescribe(")
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isDatasourceTest,
|
||||
}
|
|
@ -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",
|
||||
]
|
|
@ -0,0 +1,9 @@
|
|||
const { isDatasourceTest } = require(".")
|
||||
|
||||
module.exports = paths => {
|
||||
return {
|
||||
filtered: paths
|
||||
.filter(path => !isDatasourceTest(path))
|
||||
.map(path => ({ test: path })),
|
||||
}
|
||||
}
|
|
@ -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 })),
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue