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:
@@ -1,14 +1,15 @@
|
||||
import { DAL } from "@medusajs/types"
|
||||
import { generateEntityId } from "@medusajs/utils"
|
||||
import {
|
||||
Cascade,
|
||||
BeforeCreate,
|
||||
ManyToOne,
|
||||
Cascade,
|
||||
Entity,
|
||||
ManyToOne,
|
||||
OnInit,
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Customer from "./customer"
|
||||
import CustomerGroup from "./customer-group"
|
||||
@@ -34,7 +35,7 @@ export default class CustomerGroupCustomer {
|
||||
index: "IDX_customer_group_customer_customer_id",
|
||||
cascade: [Cascade.REMOVE],
|
||||
})
|
||||
customer: Customer
|
||||
customer: Rel<Customer>
|
||||
|
||||
@ManyToOne({
|
||||
entity: () => CustomerGroup,
|
||||
@@ -42,7 +43,7 @@ export default class CustomerGroupCustomer {
|
||||
index: "IDX_customer_group_customer_group_id",
|
||||
cascade: [Cascade.REMOVE],
|
||||
})
|
||||
customer_group: CustomerGroup
|
||||
customer_group: Rel<CustomerGroup>
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Customer from "./customer"
|
||||
import CustomerGroupCustomer from "./customer-group-customer"
|
||||
@@ -45,7 +46,7 @@ export default class CustomerGroup {
|
||||
entity: () => Customer,
|
||||
pivotEntity: () => CustomerGroupCustomer,
|
||||
})
|
||||
customers = new Collection<Customer>(this)
|
||||
customers = new Collection<Rel<Customer>>(this)
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property,
|
||||
Rel,
|
||||
} from "@mikro-orm/core"
|
||||
import Address from "./address"
|
||||
import CustomerGroup from "./customer-group"
|
||||
@@ -74,12 +75,12 @@ export default class Customer {
|
||||
entity: () => CustomerGroup,
|
||||
pivotEntity: () => CustomerGroupCustomer,
|
||||
})
|
||||
groups = new Collection<CustomerGroup>(this)
|
||||
groups = new Collection<Rel<CustomerGroup>>(this)
|
||||
|
||||
@OneToMany(() => Address, (address) => address.customer, {
|
||||
cascade: [Cascade.REMOVE],
|
||||
})
|
||||
addresses = new Collection<Address>(this)
|
||||
addresses = new Collection<Rel<Address>>(this)
|
||||
|
||||
@Property({
|
||||
onCreate: () => new Date(),
|
||||
|
||||
Reference in New Issue
Block a user