Fix up tests.
This commit is contained in:
parent
5e6a9d2176
commit
a9aa409d7c
|
@ -42,12 +42,6 @@ if (fs.existsSync("../pro/src")) {
|
|||
|
||||
const config: Config.InitialOptions = {
|
||||
projects: [
|
||||
{
|
||||
...baseConfig,
|
||||
displayName: "sequential test",
|
||||
testMatch: ["<rootDir>/**/*.seq.spec.[jt]s"],
|
||||
runner: "jest-serial-runner",
|
||||
},
|
||||
{
|
||||
...baseConfig,
|
||||
testMatch: ["<rootDir>/**/!(*.seq).spec.[jt]s"],
|
||||
|
|
|
@ -143,7 +143,6 @@
|
|||
"jest": "29.7.0",
|
||||
"jest-openapi": "0.14.2",
|
||||
"jest-runner": "29.7.0",
|
||||
"jest-serial-runner": "1.2.1",
|
||||
"nock": "^13.5.4",
|
||||
"nodemon": "2.0.15",
|
||||
"openapi-typescript": "5.2.0",
|
||||
|
|
|
@ -13,8 +13,6 @@ import mssql from "mssql"
|
|||
import { Expectations } from "src/tests/utilities/api/base"
|
||||
import { events } from "@budibase/backend-core"
|
||||
|
||||
jest.unmock("pg")
|
||||
|
||||
const createTableSQL: Record<string, string> = {
|
||||
[SourceName.POSTGRES]: `
|
||||
CREATE TABLE test_table (
|
||||
|
|
|
@ -30,7 +30,6 @@ const timestamp = new Date("2023-01-26T11:48:57.597Z").toISOString()
|
|||
tk.freeze(timestamp)
|
||||
|
||||
jest.unmock("mssql")
|
||||
jest.unmock("pg")
|
||||
|
||||
describe.each([
|
||||
["internal", undefined],
|
||||
|
|
|
@ -26,7 +26,6 @@ import { quotas } from "@budibase/pro"
|
|||
import { roles } from "@budibase/backend-core"
|
||||
|
||||
jest.unmock("mssql")
|
||||
jest.unmock("pg")
|
||||
|
||||
describe.each([
|
||||
["internal", undefined],
|
||||
|
|
|
@ -23,7 +23,6 @@ fetch.mockSearch()
|
|||
|
||||
const config = setup.getConfig()!
|
||||
|
||||
jest.unmock("pg")
|
||||
jest.mock("../websockets")
|
||||
|
||||
describe("postgres integrations", () => {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
jest.unmock("pg")
|
||||
|
||||
import { Datasource } from "@budibase/types"
|
||||
import * as postgres from "./postgres"
|
||||
import * as mongodb from "./mongodb"
|
||||
|
|
|
@ -35,11 +35,20 @@ describe("syncGlobalUsers", () => {
|
|||
builder: { global: true },
|
||||
})
|
||||
await config.doInContext(config.appId, async () => {
|
||||
expect(await rawUserMetadata()).toHaveLength(1)
|
||||
let metadata = await rawUserMetadata()
|
||||
expect(metadata).not.toContainEqual(
|
||||
expect.objectContaining({
|
||||
_id: db.generateUserMetadataID(user1._id!),
|
||||
})
|
||||
)
|
||||
expect(metadata).not.toContainEqual(
|
||||
expect.objectContaining({
|
||||
_id: db.generateUserMetadataID(user2._id!),
|
||||
})
|
||||
)
|
||||
await syncGlobalUsers()
|
||||
|
||||
const metadata = await rawUserMetadata()
|
||||
expect(metadata).toHaveLength(3)
|
||||
metadata = await rawUserMetadata()
|
||||
expect(metadata).toContainEqual(
|
||||
expect.objectContaining({
|
||||
_id: db.generateUserMetadataID(user1._id!),
|
||||
|
@ -62,7 +71,6 @@ describe("syncGlobalUsers", () => {
|
|||
await syncGlobalUsers()
|
||||
|
||||
const metadata = await rawUserMetadata()
|
||||
expect(metadata).toHaveLength(1)
|
||||
expect(metadata).not.toContainEqual(
|
||||
expect.objectContaining({
|
||||
_id: db.generateUserMetadataID(user._id!),
|
||||
|
|
Loading…
Reference in New Issue