chore: move to swc/jest (#7739)

* chore: move to swc

* chore: fix tax rate tests

* chore: undo failed test

* chore: fix unit tests script

* chore: use node 20

* Update scripts/run-workspace-unit-tests-in-chunks.sh
This commit is contained in:
Riqwan Thamir
2024-06-20 12:59:33 +02:00
committed by GitHub
parent f61557712c
commit 03924a4ff6
137 changed files with 386 additions and 419 deletions
@@ -24,6 +24,7 @@ import {
OneToOne,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Promotion from "./promotion"
import PromotionRule from "./promotion-rule"
@@ -79,21 +80,21 @@ export default class ApplicationMethod {
entity: () => Promotion,
onDelete: "cascade",
})
promotion: Promotion
promotion: Rel<Promotion>
@ManyToMany(() => PromotionRule, "method_target_rules", {
owner: true,
pivotTable: "application_method_target_rules",
cascade: ["soft-remove"] as any,
})
target_rules = new Collection<PromotionRule>(this)
target_rules = new Collection<Rel<PromotionRule>>(this)
@ManyToMany(() => PromotionRule, "method_buy_rules", {
owner: true,
pivotTable: "application_method_buy_rules",
cascade: ["soft-remove"] as any,
})
buy_rules = new Collection<PromotionRule>(this)
buy_rules = new Collection<Rel<PromotionRule>>(this)
@Property({
onCreate: () => new Date(),
@@ -21,6 +21,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Campaign from "./campaign"
@@ -45,7 +46,7 @@ export default class CampaignBudget {
@OneToOne({
entity: () => Campaign,
})
campaign: Campaign | null = null
campaign: Rel<Campaign> | null = null
@Property({ columnType: "text", nullable: true })
currency_code: string | null = null
@@ -11,6 +11,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
Unique,
} from "@mikro-orm/core"
import CampaignBudget from "./campaign-budget"
@@ -64,10 +65,10 @@ export default class Campaign {
cascade: ["soft-remove"] as any,
nullable: true,
})
budget: CampaignBudget | null = null
budget: Rel<CampaignBudget> | null = null
@OneToMany(() => Promotion, (promotion) => promotion.campaign)
promotions = new Collection<Promotion>(this)
promotions = new Collection<Rel<Promotion>>(this)
@Property({
onCreate: () => new Date(),
@@ -7,6 +7,7 @@ import {
OnInit,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import PromotionRule from "./promotion-rule"
@@ -21,7 +22,7 @@ export default class PromotionRuleValue {
fieldName: "promotion_rule_id",
index: "IDX_promotion_rule_promotion_rule_value_id",
})
promotion_rule: PromotionRule
promotion_rule: Rel<PromotionRule>
@Property({ columnType: "text" })
value: string
@@ -14,6 +14,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ApplicationMethod from "./application-method"
import Promotion from "./promotion"
@@ -44,22 +45,22 @@ export default class PromotionRule {
@OneToMany(() => PromotionRuleValue, (prv) => prv.promotion_rule, {
cascade: [Cascade.REMOVE],
})
values = new Collection<PromotionRuleValue>(this)
values = new Collection<Rel<PromotionRuleValue>>(this)
@ManyToMany(() => Promotion, (promotion) => promotion.rules)
promotions = new Collection<Promotion>(this)
promotions = new Collection<Rel<Promotion>>(this)
@ManyToMany(
() => ApplicationMethod,
(applicationMethod) => applicationMethod.target_rules
)
method_target_rules = new Collection<ApplicationMethod>(this)
method_target_rules = new Collection<Rel<ApplicationMethod>>(this)
@ManyToMany(
() => ApplicationMethod,
(applicationMethod) => applicationMethod.buy_rules
)
method_buy_rules = new Collection<ApplicationMethod>(this)
method_buy_rules = new Collection<Rel<ApplicationMethod>>(this)
@Property({
onCreate: () => new Date(),
@@ -19,6 +19,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
Unique,
} from "@mikro-orm/core"
import ApplicationMethod from "./application-method"
@@ -55,7 +56,7 @@ export default class Promotion {
campaign_id: string | null = null
@ManyToOne(() => Campaign, { persist: false })
campaign: Campaign | null
campaign: Rel<Campaign> | null
@Property({ columnType: "boolean", default: false })
is_automatic: boolean = false
@@ -69,14 +70,14 @@ export default class Promotion {
mappedBy: (am) => am.promotion,
cascade: ["soft-remove"] as any,
})
application_method: ApplicationMethod
application_method: Rel<ApplicationMethod>
@ManyToMany(() => PromotionRule, "promotions", {
owner: true,
pivotTable: "promotion_promotion_rule",
cascade: ["soft-remove"] as any,
})
rules = new Collection<PromotionRule>(this)
rules = new Collection<Rel<PromotionRule>>(this)
@Property({
onCreate: () => new Date(),