Extra typings

This commit is contained in:
Adria Navarro 2023-01-20 11:48:11 +00:00
parent 62b372ce59
commit 27171e7680
5 changed files with 31 additions and 25 deletions

View File

@ -4,7 +4,7 @@ import { AppStatus } from "../../../db/utils"
import * as setup from "./utilities"
describe("/cloud", () => {
let request = setup.getRequest()
let request = setup.getRequest()!
let config = setup.getConfig()
afterAll(setup.afterAll)
@ -25,7 +25,7 @@ describe("/cloud", () => {
await request
.post(
`/api/applications/${dbCore.getProdAppID(
config.getAppId()
config.getAppId()!
)}/unpublish`
)
.set(config.defaultHeaders())

View File

@ -46,7 +46,7 @@ export function delay(ms: number) {
}
let request: supertest.SuperTest<supertest.Test> | undefined | null,
config: TestConfig
config: TestConfig | null
export function beforeAll() {
config = new TestConfig()
@ -60,6 +60,7 @@ export function afterAll() {
// clear app files
request = null
config = null
}
export function getRequest() {

View File

@ -15,11 +15,12 @@ import {
} from "@budibase/types"
import _ from "lodash"
const config = setup.getConfig()
const config = setup.getConfig()!
jest.unmock("node-fetch")
describe("row api - postgres", () => {
// TODO: Waiting for the test image to exist
describe.skip("row api - postgres", () => {
let apiKey,
makeRequest: MakeRequestResponse,
postgresDatasource: Datasource,
@ -30,19 +31,21 @@ describe("row api - postgres", () => {
await config.init()
apiKey = await config.generateApiKey()
postgresDatasource = await config.createDatasource({
type: "datasource",
source: SourceName.POSTGRES,
plus: true,
config: {
host: "192.168.1.98",
port: 54321,
database: "postgres",
user: "root",
password: "root",
schema: "public",
ssl: false,
rejectUnauthorized: false,
ca: false,
datasource: {
type: "datasource",
source: SourceName.POSTGRES,
plus: true,
config: {
host: "192.168.1.98",
port: 54321,
database: "postgres",
user: "root",
password: "root",
schema: "public",
ssl: false,
rejectUnauthorized: false,
ca: false,
},
},
})

View File

@ -145,11 +145,13 @@ class TestConfiguration {
if (this.allApps) {
cleanup(this.allApps.map(app => app.appId))
await this._req(
null,
{ appId: this.prodApp.appId },
controllers.app.destroy
)
if (env.isDockerisedTest()) {
await this._req(
null,
{ appId: this.prodApp.appId },
controllers.app.destroy
)
}
}
if (this.server) {
@ -300,7 +302,7 @@ class TestConfiguration {
})
}
defaultHeaders(extras = {}, isInternal: boolean) {
defaultHeaders(extras = {}, isInternal: boolean = false) {
const authObj = {
userId: GLOBAL_USER_ID,
sessionId: "sessionid",

View File

@ -8,7 +8,7 @@ export interface Datasource extends Document {
source: SourceName
// the config is defined by the schema
config?: {
[key: string]: string | number | boolean
[key: string]: string | number | boolean | any[]
}
plus?: boolean
entities?: {