Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "emocks", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Mock server based on expressjs", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha" | ||
"test": "jest", | ||
"build": "tsc", | ||
"prepublish": "npm run build" | ||
}, | ||
@@ -25,12 +27,21 @@ "repository": { | ||
"devDependencies": { | ||
"express": "^4.13.3", | ||
"istanbul": "^0.3.21", | ||
"mocha": "^2.3.3", | ||
"supertest": "^1.1.0" | ||
"@babel/core": "^7.16.7", | ||
"@babel/preset-env": "^7.16.7", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@types/express": "^4.17.13", | ||
"@types/jest": "^27.4.0", | ||
"@types/lodash": "^4.14.178", | ||
"@types/node": "^17.0.8", | ||
"@types/rimraf": "^3.0.2", | ||
"@types/supertest": "^2.0.11", | ||
"babel-jest": "^27.4.6", | ||
"express": "^4.17.2", | ||
"jest": "^27.4.7", | ||
"supertest": "^6.1.6", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.5.4" | ||
}, | ||
"dependencies": { | ||
"fs-extra": "^0.24.0", | ||
"lodash": "^3.10.1", | ||
"rimraf": "^2.4.3" | ||
"lodash": "^4.17.21" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # emocks | ||
## How does it work? | ||
* Organize all your mocks using folder structure, that will correspond your api url. | ||
* Organize all of your mocks using folder structure, representing your api url | ||
* You can use HTTP VERBS as file names to create different mocks | ||
@@ -13,3 +13,2 @@ * You can use static .json files for responses or .js modules, that can create dynamic answers | ||
* custom headers | ||
* live update | ||
@@ -19,3 +18,3 @@ ## Installation | ||
## Example | ||
Assume we have the following folder structure: | ||
Assuming we have the following folder structure: | ||
``` | ||
@@ -31,8 +30,8 @@ |-- mocks | ||
```javascript | ||
var path = require('path'); | ||
var express = require('express'); | ||
var emocks = require('emocks'); | ||
var bodyParser = require('body-parser'); | ||
const path = require('path'); | ||
const express = require('express'); | ||
const emocks = require('emocks'); | ||
const bodyParser = require('body-parser'); | ||
var app = express(); | ||
const app = express(); | ||
app.use(bodyParser.json()); | ||
@@ -98,9 +97,9 @@ app.use('/', emocks(path.join(__dirname, './mocks'))); | ||
headers: { "X-Custom-Global-Header": "Hello!" }, | ||
//rebind mocks on file changes | ||
watch: true | ||
}); | ||
``` | ||
### Now supports typescript! | ||
## Additional info | ||
Please offer suggestions via issues. | ||
emocks is an abbreviation for express mocks. Any similarity to emacs is unintended. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 2 instances in 1 package
28981
1
19
647
15
101
1
+ Addedlodash@4.17.21(transitive)
- Removedfs-extra@^0.24.0
- Removedrimraf@^2.4.3
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedfs-extra@0.24.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedjsonfile@2.4.0(transitive)
- Removedlodash@3.10.1(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedlodash@^4.17.21