Creates test request helper for API endpoints

Separates common utils into the medusa-core-utils package.
Sets up a testing environment where mocked models/services/etc. can be placed in
__mocks__ folder within its corresponding directory. The mocks will
automatically be registered in a awilix container only used for testing.
This commit is contained in:
Sebastian Rindom
2020-01-21 15:13:47 +01:00
parent 3d494bc652
commit ed472e9fba
33 changed files with 14053 additions and 76 deletions
+6 -2
View File
@@ -19,10 +19,12 @@
"@babel/preset-env": "^7.7.5",
"@babel/register": "^7.7.4",
"@babel/runtime": "^7.7.6",
"client-sessions": "^0.8.0",
"eslint": "^6.7.2",
"jest": "^24.9.0",
"nodemon": "^2.0.1",
"prettier": "^1.19.1"
"prettier": "^1.19.1",
"supertest": "^4.0.2"
},
"scripts": {
"start": "nodemon --watch plugins/ --watch src/ --exec babel-node src/app.js",
@@ -42,13 +44,15 @@
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-session": "^1.17.0",
"joi-objectid": "^3.0.1",
"fs-exists-cached": "^1.0.0",
"glob": "^7.1.6",
"joi-objectid": "^3.0.1",
"jsonwebtoken": "^8.5.1",
"medusa-core-utils": "^1.0.0",
"mongoose": "^5.8.0",
"morgan": "^1.9.1",
"passport": "^0.4.0",
"passport-http-bearer": "^1.0.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"regenerator-runtime": "^0.13.3",