feat: Add http integration tests and enable them in pipeline (#7532)
This commit is contained in:
4
integration-tests/http/.gitignore
vendored
Normal file
4
integration-tests/http/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
dist/
|
||||
node_modules
|
||||
*yarn-error.log
|
||||
|
||||
2809
integration-tests/http/__tests__/product/admin/product.spec.ts
Normal file
2809
integration-tests/http/__tests__/product/admin/product.spec.ts
Normal file
File diff suppressed because it is too large
Load Diff
12
integration-tests/http/jest.config.js
Normal file
12
integration-tests/http/jest.config.js
Normal file
@@ -0,0 +1,12 @@
|
||||
process.chdir(__dirname)
|
||||
|
||||
module.exports = {
|
||||
name: "HTTP Integration Tests",
|
||||
testEnvironment: `node`,
|
||||
rootDir: "./",
|
||||
transformIgnorePatterns: ["/dist", "/node_modules/"],
|
||||
transform: {
|
||||
"^.+\\.[jt]s$": ["@swc/jest"],
|
||||
},
|
||||
setupFiles: ["../setup-env.js"],
|
||||
}
|
||||
19
integration-tests/http/medusa-config.js
Normal file
19
integration-tests/http/medusa-config.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { defineConfig } = require("@medusajs/utils")
|
||||
const DB_HOST = process.env.DB_HOST
|
||||
const DB_USERNAME = process.env.DB_USERNAME
|
||||
const DB_PASSWORD = process.env.DB_PASSWORD
|
||||
const DB_NAME = process.env.DB_TEMP_NAME
|
||||
const DB_URL = `postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}`
|
||||
process.env.DATABASE_URL = DB_URL
|
||||
process.env.LOG_LEVEL = "error"
|
||||
|
||||
module.exports = defineConfig({
|
||||
admin: {
|
||||
disable: true,
|
||||
},
|
||||
projectConfig: {
|
||||
http: {
|
||||
jwtSecret: "test",
|
||||
},
|
||||
},
|
||||
})
|
||||
45
integration-tests/http/package.json
Normal file
45
integration-tests/http/package.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "integration-tests-http",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test:integration": "jest --no-cache --maxWorkers=50% --bail --detectOpenHandles --forceExit --logHeapUsage",
|
||||
"test:integration:chunk": "jest --silent --no-cache --bail --maxWorkers=50% --forceExit --testPathPattern=$(echo $CHUNKS | jq -r \".[${CHUNK}] | .[]\")",
|
||||
"build": "tsc ./src/* --allowJs --outDir ./dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@medusajs/api-key": "workspace:^",
|
||||
"@medusajs/auth": "workspace:*",
|
||||
"@medusajs/cache-inmemory": "workspace:*",
|
||||
"@medusajs/customer": "workspace:^",
|
||||
"@medusajs/event-bus-local": "workspace:*",
|
||||
"@medusajs/fulfillment": "workspace:^",
|
||||
"@medusajs/fulfillment-manual": "workspace:^",
|
||||
"@medusajs/inventory-next": "workspace:^",
|
||||
"@medusajs/medusa": "workspace:*",
|
||||
"@medusajs/modules-sdk": "workspace:^",
|
||||
"@medusajs/pricing": "workspace:^",
|
||||
"@medusajs/product": "workspace:^",
|
||||
"@medusajs/promotion": "workspace:^",
|
||||
"@medusajs/region": "workspace:^",
|
||||
"@medusajs/stock-location-next": "workspace:^",
|
||||
"@medusajs/store": "workspace:^",
|
||||
"@medusajs/tax": "workspace:^",
|
||||
"@medusajs/user": "workspace:^",
|
||||
"@medusajs/utils": "workspace:^",
|
||||
"@medusajs/workflow-engine-inmemory": "workspace:*",
|
||||
"faker": "^5.5.3",
|
||||
"medusa-test-utils": "workspace:*",
|
||||
"pg": "^8.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@medusajs/types": "workspace:^",
|
||||
"@swc/core": "^1.4.8",
|
||||
"@swc/jest": "^0.2.36",
|
||||
"jest": "^26.6.3",
|
||||
"jest-environment-node": "26.6.2",
|
||||
"typescript": "^4.1.3"
|
||||
}
|
||||
}
|
||||
1
integration-tests/http/src/index.js
Normal file
1
integration-tests/http/src/index.js
Normal file
@@ -0,0 +1 @@
|
||||
// noop
|
||||
Reference in New Issue
Block a user