Allow running api prod tests
This commit is contained in:
parent
610621823c
commit
e93934111f
|
@ -40,6 +40,7 @@ export interface RequestOpts {
|
||||||
>
|
>
|
||||||
expectations?: Expectations
|
expectations?: Expectations
|
||||||
publicUser?: boolean
|
publicUser?: boolean
|
||||||
|
useProdApp?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export abstract class TestAPI {
|
export abstract class TestAPI {
|
||||||
|
@ -108,7 +109,8 @@ export abstract class TestAPI {
|
||||||
|
|
||||||
const headersFn = publicUser
|
const headersFn = publicUser
|
||||||
? this.config.publicHeaders.bind(this.config)
|
? this.config.publicHeaders.bind(this.config)
|
||||||
: this.config.defaultHeaders.bind(this.config)
|
: (extras = {}) =>
|
||||||
|
this.config.defaultHeaders.bind(this.config)(extras, opts?.useProdApp)
|
||||||
|
|
||||||
const app = getServer()
|
const app = getServer()
|
||||||
let req = request(app)[method](url)
|
let req = request(app)[method](url)
|
||||||
|
|
|
@ -109,7 +109,7 @@ export class RowActionAPI extends TestAPI {
|
||||||
rowActionId: string,
|
rowActionId: string,
|
||||||
body: RowActionTriggerRequest,
|
body: RowActionTriggerRequest,
|
||||||
expectations?: Expectations,
|
expectations?: Expectations,
|
||||||
config?: { publicUser?: boolean }
|
config?: { publicUser?: boolean; useProdApp?: boolean }
|
||||||
) => {
|
) => {
|
||||||
return await this._post<RowActionResponse>(
|
return await this._post<RowActionResponse>(
|
||||||
`/api/tables/${tableId}/actions/${rowActionId}/trigger`,
|
`/api/tables/${tableId}/actions/${rowActionId}/trigger`,
|
||||||
|
|
Loading…
Reference in New Issue