Fix plugin.spec.ts.

This commit is contained in:
Sam Rose 2025-03-04 16:24:21 +00:00
parent b077e5f24b
commit 8276a9ede7
No known key found for this signature in database
4 changed files with 2 additions and 27 deletions

View File

@ -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) {

View File

@ -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 () => {

View File

@ -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()
}) })

View File

@ -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> {