running tests
This commit is contained in:
@@ -150,7 +150,7 @@ if (process.env.NODE_ENV === "development") {
|
||||
console.log(`Master ${process.pid} is running`);
|
||||
console.log("Number of CPUs", numCPUs);
|
||||
|
||||
let numWorkers = 8;
|
||||
let numWorkers = 10;
|
||||
|
||||
for (let i = 0; i < numWorkers; i++) {
|
||||
cluster.fork();
|
||||
|
||||
@@ -81,7 +81,7 @@ export const updateOtherCusProdsWithNewSchedule = async ({
|
||||
}) => {
|
||||
const otherCusProducts = getCusProductsWithStripeSubId({
|
||||
cusProducts: attachParams.cusProducts!,
|
||||
stripeSubId: otherSub.id,
|
||||
stripeSubId: otherSub?.id,
|
||||
});
|
||||
|
||||
if (otherCusProducts.length > 0) {
|
||||
|
||||
@@ -109,12 +109,12 @@ describe(`${chalk.yellowBright(`${testCase}: Testing upgrades with arrear prorat
|
||||
{
|
||||
id: "entity1",
|
||||
name: "entity1",
|
||||
featureId: TestFeature.Users,
|
||||
feature_id: TestFeature.Users,
|
||||
},
|
||||
{
|
||||
id: "entity2",
|
||||
name: "entity2",
|
||||
featureId: TestFeature.Users,
|
||||
feature_id: TestFeature.Users,
|
||||
},
|
||||
]);
|
||||
numUsers = 2;
|
||||
@@ -148,7 +148,7 @@ describe(`${chalk.yellowBright(`${testCase}: Testing upgrades with arrear prorat
|
||||
{
|
||||
id: "entity3",
|
||||
name: "entity3",
|
||||
featureId: TestFeature.Users,
|
||||
feature_id: TestFeature.Users,
|
||||
},
|
||||
]);
|
||||
numUsers += 1;
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
import { createSupabaseClient } from "@/external/supabaseUtils.js";
|
||||
import { OrgService } from "@/internal/orgs/OrgService.js";
|
||||
import { initDrizzle } from "@/db/initDrizzle.js";
|
||||
import { FeatureService } from "@/internal/features/FeatureService.js";
|
||||
|
||||
export const features: Record<string, Feature & { eventName: string }> = {
|
||||
boolean1: initFeature({
|
||||
@@ -863,11 +864,11 @@ before(async function () {
|
||||
slug: ORG_SLUG,
|
||||
});
|
||||
|
||||
let { data: dbFeatures, error } = await this.sb
|
||||
.from("features")
|
||||
.select("*")
|
||||
.eq("org_id", this.org.id)
|
||||
.eq("env", this.env);
|
||||
const dbFeatures = await FeatureService.list({
|
||||
db: this.db,
|
||||
orgId: this.org.id,
|
||||
env: this.env,
|
||||
});
|
||||
|
||||
const cleanFeatures = (features: Record<string, Feature>) => {
|
||||
for (const featureId in features) {
|
||||
|
||||
Reference in New Issue
Block a user