fix: integration tests modules expectations (#6848)

**What**
- fix tests
- cleanup deprecated jest conf
This commit is contained in:
Adrien de Peretti
2024-03-27 16:39:20 +01:00
committed by GitHub
parent 5d9aea053c
commit d4d1f9b2f2
41 changed files with 41 additions and 63 deletions

View File

@@ -37,7 +37,7 @@ medusaIntegrationTestRunner({
application_method: {
type: "fixed",
target_type: "order",
value: "100",
value: 100,
},
},
])
@@ -69,14 +69,14 @@ medusaIntegrationTestRunner({
})
it("should get all promotions and its count filtered", async () => {
const [createdPromotion] = await promotionModuleService.create([
await promotionModuleService.create([
{
code: "TEST",
type: PromotionType.STANDARD,
application_method: {
type: "fixed",
target_type: "order",
value: "100",
value: 100,
},
},
])
@@ -95,7 +95,6 @@ medusaIntegrationTestRunner({
created_at: expect.any(String),
application_method: {
id: expect.any(String),
promotion: expect.any(Object),
},
},
])

View File

@@ -75,7 +75,6 @@ medusaIntegrationTestRunner({
ends_at: expect.any(String),
budget: {
id: expect.any(String),
campaign: expect.any(Object),
type: "spend",
limit: 1000,
raw_limit: {

View File

@@ -1,7 +1,7 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: false,
},
},

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -10,7 +10,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -10,7 +10,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -8,7 +8,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -1,7 +1,7 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: false,
},
},

View File

@@ -1,7 +1,7 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: false,
},
},

View File

@@ -1,7 +1,7 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: false,
},
},

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -1,7 +1,7 @@
module.exports = {
globals: {
"ts-jest": {
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: false,
},
},

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -8,7 +8,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -296,9 +296,6 @@ moduleIntegrationTestRunner({
starts_at: updateDate,
prices: expect.arrayContaining([
expect.objectContaining({
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 400,
currency_code: "EUR",
}),
@@ -449,9 +446,6 @@ moduleIntegrationTestRunner({
id: expect.any(String),
prices: expect.arrayContaining([
expect.objectContaining({
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 400,
currency_code: "EUR",
}),
@@ -565,18 +559,12 @@ moduleIntegrationTestRunner({
value: "DE",
}),
]),
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 400,
currency_code: "EUR",
}),
expect.objectContaining({
rules_count: 0,
price_rules: [],
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 600,
currency_code: "EUR",
}),
@@ -698,9 +686,6 @@ moduleIntegrationTestRunner({
prices: expect.arrayContaining([
expect.objectContaining({
rules_count: 0,
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 123,
currency_code: "EUR",
}),
@@ -809,9 +794,6 @@ moduleIntegrationTestRunner({
prices: expect.arrayContaining([
expect.objectContaining({
rules_count: 1,
price_list: expect.objectContaining({
id: expect.any(String),
}),
price_rules: [
expect.objectContaining({
value: "EU",
@@ -919,9 +901,6 @@ moduleIntegrationTestRunner({
}),
}),
]),
price_list: expect.objectContaining({
id: expect.any(String),
}),
amount: 123,
currency_code: "EUR",
}),

View File

@@ -1,9 +1,10 @@
import { SqlEntityManager } from "@mikro-orm/postgresql"
import { createRuleTypes } from "../../../__fixtures__/rule-type"
import { moduleIntegrationTestRunner, SuiteOptions } from "medusa-test-utils"
import { Modules } from "@medusajs/modules-sdk"
import { IPricingModuleService } from "@medusajs/types"
jest.setTimeout(30000)
moduleIntegrationTestRunner({
moduleName: Modules.PRICING,
testSuite: ({

View File

@@ -10,7 +10,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -70,7 +70,6 @@ moduleIntegrationTestRunner({
name: "campaign 1",
budget: expect.objectContaining({
id: expect.any(String),
campaign: expect.any(Object),
limit: 1000,
}),
},

View File

@@ -958,7 +958,6 @@ moduleIntegrationTestRunner({
code: "PROMOTION_1",
application_method: {
id: expect.any(String),
promotion: expect.any(Object),
type: "fixed",
},
},

View File

@@ -10,7 +10,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -21,6 +21,8 @@ const afterEach_ = async () => {
await TestDatabase.clearTables(sharedPgConnection)
}
jest.setTimeout(50000)
describe("Workflow Orchestrator module", function () {
describe("Testing basic workflow", function () {
let workflowOrcModule: IWorkflowEngineService

View File

@@ -9,7 +9,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -8,7 +8,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.spec.json",
tsconfig: "tsconfig.spec.json",
isolatedModules: true,
},
],

View File

@@ -3,7 +3,7 @@ module.exports = {
"^.+\\.[jt]s?$": [
"ts-jest",
{
tsConfig: "tsconfig.json",
tsconfig: "tsconfig.json",
isolatedModules: true,
},
],