1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Adding parameterised tests.

This commit is contained in:
mike12345567 2024-06-28 15:21:39 +01:00
parent 13ac273c83
commit b3d07aa228

View file

@ -2109,25 +2109,28 @@ describe.each([
})
})
describe("special data_ case", () => {
describe.each(["data_name_test", "name_data_test", "name_test_data_"])(
"special (%s) case",
column => {
beforeAll(async () => {
table = await createTable({
name_data_test: {
name: "name_data_test",
[column]: {
name: column,
type: FieldType.STRING,
},
})
await createRows([{ name_data_test: "a" }, { name_data_test: "b" }])
await createRows([{ [column]: "a" }, { [column]: "b" }])
})
it("should be able to query a column with data_ in it", async () => {
await expectSearch({
query: {
equal: {
["1:name_data_test"]: "a",
[`1:${column}`]: "a",
},
},
}).toContainExactly([{ name_data_test: "a" }])
})
}).toContainExactly([{ [column]: "a" }])
})
}
)
})