Fix plugin.spec.ts.
This commit is contained in:
parent
b077e5f24b
commit
8276a9ede7
|
@ -87,9 +87,7 @@ export class InMemoryQueue<T = any> implements Partial<Queue<T>> {
|
||||||
*/
|
*/
|
||||||
async process(concurrencyOrFunc: number | any, func?: any) {
|
async process(concurrencyOrFunc: number | any, func?: any) {
|
||||||
func = typeof concurrencyOrFunc === "number" ? func : concurrencyOrFunc
|
func = typeof concurrencyOrFunc === "number" ? func : concurrencyOrFunc
|
||||||
this._emitter.on("message", async msg => {
|
this._emitter.on("message", async message => {
|
||||||
const message = msg
|
|
||||||
|
|
||||||
// For the purpose of testing, don't trigger cron jobs immediately.
|
// For the purpose of testing, don't trigger cron jobs immediately.
|
||||||
// Require the test to trigger them manually with timestamps.
|
// Require the test to trigger them manually with timestamps.
|
||||||
if (!message.manualTrigger && message.opts?.repeat != null) {
|
if (!message.manualTrigger && message.opts?.repeat != null) {
|
||||||
|
|
|
@ -166,18 +166,6 @@ if (descriptions.length) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// const resetRowUsage = async () => {
|
|
||||||
// await config.doInContext(
|
|
||||||
// undefined,
|
|
||||||
// async () =>
|
|
||||||
// await quotas.setUsage(
|
|
||||||
// 0,
|
|
||||||
// StaticQuotaName.ROWS,
|
|
||||||
// QuotaUsageType.STATIC
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
const getRowUsage = async () => {
|
const getRowUsage = async () => {
|
||||||
const { total } = await config.doInContext(undefined, () =>
|
const { total } = await config.doInContext(undefined, () =>
|
||||||
quotas.getCurrentUsageValues(
|
quotas.getCurrentUsageValues(
|
||||||
|
@ -225,10 +213,6 @@ if (descriptions.length) {
|
||||||
table = await config.api.table.save(defaultTable())
|
table = await config.api.table.save(defaultTable())
|
||||||
})
|
})
|
||||||
|
|
||||||
beforeEach(async () => {
|
|
||||||
// await resetRowUsage()
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("create", () => {
|
describe("create", () => {
|
||||||
it("creates a new row successfully", async () => {
|
it("creates a new row successfully", async () => {
|
||||||
await expectRowUsage(isInternal ? 1 : 0, async () => {
|
await expectRowUsage(isInternal ? 1 : 0, async () => {
|
||||||
|
|
|
@ -3,7 +3,6 @@ import * as matchers from "jest-extended"
|
||||||
import { env as coreEnv, timers } from "@budibase/backend-core"
|
import { env as coreEnv, timers } from "@budibase/backend-core"
|
||||||
import { testContainerUtils } from "@budibase/backend-core/tests"
|
import { testContainerUtils } from "@budibase/backend-core/tests"
|
||||||
import nock from "nock"
|
import nock from "nock"
|
||||||
import { quotas } from "@budibase/pro"
|
|
||||||
|
|
||||||
expect.extend(matchers)
|
expect.extend(matchers)
|
||||||
if (!process.env.CI) {
|
if (!process.env.CI) {
|
||||||
|
@ -25,6 +24,7 @@ nock.enableNetConnect(host => {
|
||||||
testContainerUtils.setupEnv(env, coreEnv)
|
testContainerUtils.setupEnv(env, coreEnv)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
|
const quotas = require("@budibase/pro").quotas
|
||||||
quotas.disable()
|
quotas.disable()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -293,13 +293,6 @@ class Orchestrator {
|
||||||
|
|
||||||
hasErrored(context: AutomationContext): boolean {
|
hasErrored(context: AutomationContext): boolean {
|
||||||
return context._error === true
|
return context._error === true
|
||||||
// const [_trigger, ...steps] = context.steps
|
|
||||||
// for (const step of steps) {
|
|
||||||
// if (step.success === false) {
|
|
||||||
// return true
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async execute(): Promise<AutomationResults> {
|
async execute(): Promise<AutomationResults> {
|
||||||
|
|
Loading…
Reference in New Issue