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
@@ -16,6 +16,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Fulfillment from "./fulfillment"
@@ -86,7 +87,7 @@ export default class FulfillmentItem {
fulfillment_id: string
@ManyToOne(() => Fulfillment, { persist: false })
fulfillment: Fulfillment
fulfillment: Rel<Fulfillment>
@Property({
onCreate: () => new Date(),
@@ -14,6 +14,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Fulfillment from "./fulfillment"
@@ -58,7 +59,7 @@ export default class FulfillmentLabel {
fulfillment_id: string
@ManyToOne(() => Fulfillment, { persist: false })
fulfillment: Fulfillment
fulfillment: Rel<Fulfillment>
@Property({
onCreate: () => new Date(),
@@ -16,6 +16,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ServiceZone from "./service-zone"
@@ -56,7 +57,7 @@ export default class FulfillmentSet {
cascade: [Cascade.PERSIST, "soft-remove"] as any,
orphanRemoval: true,
})
service_zones = new Collection<ServiceZone>(this)
service_zones = new Collection<Rel<ServiceZone>>(this)
@Property({
onCreate: () => new Date(),
@@ -18,6 +18,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Address from "./address"
import FulfillmentItem from "./fulfillment-item"
@@ -117,7 +118,7 @@ export default class Fulfillment {
shipping_option: ShippingOption | null
@ManyToOne(() => FulfillmentProvider, { persist: false })
provider: FulfillmentProvider
provider: Rel<FulfillmentProvider>
@OneToOne({
entity: () => Address,
@@ -126,19 +127,19 @@ export default class Fulfillment {
nullable: true,
onDelete: "cascade",
})
delivery_address!: Address
delivery_address!: Rel<Address>
@OneToMany(() => FulfillmentItem, (item) => item.fulfillment, {
cascade: [Cascade.PERSIST, "soft-remove"] as any,
orphanRemoval: true,
})
items = new Collection<FulfillmentItem>(this)
items = new Collection<Rel<FulfillmentItem>>(this)
@OneToMany(() => FulfillmentLabel, (label) => label.fulfillment, {
cascade: [Cascade.PERSIST, "soft-remove"] as any,
orphanRemoval: true,
})
labels = new Collection<FulfillmentLabel>(this)
labels = new Collection<Rel<FulfillmentLabel>>(this)
@Property({
onCreate: () => new Date(),
@@ -16,6 +16,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ServiceZone from "./service-zone"
@@ -92,7 +93,7 @@ export default class GeoZone {
@ManyToOne(() => ServiceZone, {
persist: false,
})
service_zone: ServiceZone
service_zone: Rel<ServiceZone>
@Property({
onCreate: () => new Date(),
@@ -18,6 +18,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import FulfillmentSet from "./fulfillment-set"
import GeoZone from "./geo-zone"
@@ -71,13 +72,13 @@ export default class ServiceZone {
fulfillment_set_id: string
@ManyToOne(() => FulfillmentSet, { persist: false })
fulfillment_set: FulfillmentSet
fulfillment_set: Rel<FulfillmentSet>
@OneToMany(() => GeoZone, "service_zone", {
cascade: [Cascade.PERSIST, "soft-remove"] as any,
orphanRemoval: true,
})
geo_zones = new Collection<GeoZone>(this)
geo_zones = new Collection<Rel<GeoZone>>(this)
@OneToMany(
() => ShippingOption,
@@ -87,7 +88,7 @@ export default class ServiceZone {
orphanRemoval: true,
}
)
shipping_options = new Collection<ShippingOption>(this)
shipping_options = new Collection<Rel<ShippingOption>>(this)
@Property({
onCreate: () => new Date(),
@@ -15,6 +15,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ShippingOption from "./shipping-option"
@@ -64,7 +65,7 @@ export default class ShippingOptionRule {
@ManyToOne(() => ShippingOption, {
persist: false,
})
shipping_option: ShippingOption
shipping_option: Rel<ShippingOption>
@Property({
onCreate: () => new Date(),
@@ -14,6 +14,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ShippingOption from "./shipping-option"
@@ -52,7 +53,7 @@ export default class ShippingOptionType {
type: "text",
onDelete: "cascade",
})
shipping_option: ShippingOption
shipping_option: Rel<ShippingOption>
@Property({
onCreate: () => new Date(),
@@ -21,6 +21,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import Fulfillment from "./fulfillment"
import FulfillmentProvider from "./fulfillment-provider"
@@ -118,17 +119,17 @@ export default class ShippingOption {
metadata: Record<string, unknown> | null = null
@ManyToOne(() => ServiceZone, { persist: false })
service_zone: ServiceZone
service_zone: Rel<ServiceZone>
@ManyToOne(() => ShippingProfile, {
persist: false,
})
shipping_profile: ShippingProfile | null
shipping_profile: Rel<ShippingProfile> | null
@ManyToOne(() => FulfillmentProvider, {
persist: false,
})
provider: FulfillmentProvider | null
provider: Rel<FulfillmentProvider> | null
@OneToOne(() => ShippingOptionType, (so) => so.shipping_option, {
owner: true,
@@ -137,16 +138,16 @@ export default class ShippingOption {
fieldName: "shipping_option_type_id",
onDelete: "cascade",
})
type: ShippingOptionType
type: Rel<ShippingOptionType>
@OneToMany(() => ShippingOptionRule, "shipping_option", {
cascade: [Cascade.PERSIST, "soft-remove"] as any,
orphanRemoval: true,
})
rules = new Collection<ShippingOptionRule>(this)
rules = new Collection<Rel<ShippingOptionRule>>(this)
@OneToMany(() => Fulfillment, (fulfillment) => fulfillment.shipping_option)
fulfillments = new Collection<Fulfillment>(this)
fulfillments = new Collection<Rel<Fulfillment>>(this)
@Property({
onCreate: () => new Date(),
@@ -16,6 +16,7 @@ import {
OptionalProps,
PrimaryKey,
Property,
Rel,
} from "@mikro-orm/core"
import ShippingOption from "./shipping-option"
@@ -55,7 +56,7 @@ export default class ShippingProfile {
() => ShippingOption,
(shippingOption) => shippingOption.shipping_profile
)
shipping_options = new Collection<ShippingOption>(this)
shipping_options = new Collection<Rel<ShippingOption>>(this)
@Property({ columnType: "jsonb", nullable: true })
metadata: Record<string, unknown> | null = null