Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Mollweide committed Jul 15, 2016
2 parents 23c7330 + 8c35853 commit fc04676
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 54 deletions.
13 changes: 8 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@

## [0.8.1](https://github.com/smollweide/node-mock-server/issues?q=milestone%3A0.8.1)
## [0.8.2](https://github.com/smollweide/node-mock-server/releases/tag/0.8.2)
- [ae39c25] Create fallback to 'success' if custom response file is missing

## [0.8.1](https://github.com/smollweide/node-mock-server/releases/tag/0.8.1)
- Fix: Validation: ignore "cannot read file" when response_schema.json is empty #19
- Fix: Validation: set minimum response delay #20
- Prettify logs

## [0.8.0](https://github.com/smollweide/node-mock-server/issues?q=milestone%3A0.8.0)
## [0.8.0](https://github.com/smollweide/node-mock-server/releases/tag/0.8.0)
- More readable schema structure and faker DTO response functions

## [0.7.4](https://github.com/smollweide/node-mock-server/issues?q=milestone%3A0.7.4)
## [0.7.4](https://github.com/smollweide/node-mock-server/releases/tag/0.7.4)
- Different success files for different params #14
- Fix: Preview not working with as expected with params in success.json #11

## [0.7.3](https://github.com/smollweide/node-mock-server/issues?q=milestone%3A0.7.3)
## [0.7.3](https://github.com/smollweide/node-mock-server/releases/tag/0.7.3)
- Fix: First level calls are detected as invalid path #12

## [0.7.2](https://github.com/smollweide/node-mock-server/issues?q=milestone%3A0.7.2)
## [0.7.2](https://github.com/smollweide/node-mock-server/releases/tag/0.7.2)
- Add dynamic path params to ejs object #9
- Detect empty dynamic path params and return error #8
- Store validation results in just one file #3
Expand Down
7 changes: 7 additions & 0 deletions controller/MockController.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ MockController.prototype = extend(MockController.prototype, {

responseFilePath = dir + 'mock/' + expectedResponse + '.json';

// Fallback to success.json
if (!this.existFile(responseFilePath)) {
expectedResponse = 'success';
responseFilePath = dir + 'mock/success.json';
this.writeFile(dir + 'mock/response.txt', 'success');
}

options = {
req: req,
res: res,
Expand Down
98 changes: 49 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"name": "node-mock-server",
"version": "0.8.1",
"description": "File based Node API mock server",
"email": "[email protected]",
"author": "Simon Mollweide <[email protected]>",
"url": "https://github.com/smollweide/node-mock-server",
"repository": {
"type": "github",
"url": "https://github.com/smollweide/node-mock-server"
},
"bugs": {
"url": "https://github.com/smollweide/node-mock-server/issues"
},
"scripts": {
"start": "node app.js",
"test": "./node_modules/mocha/bin/mocha ./test/tests.js"
},
"main": "mock-server.js",
"keywords": [
"node",
"npm",
"mock",
"rest",
"rest API",
"json",
"DTO",
"Swagger"
],
"engines": {
"node": ">=0.12.7"
},
"preferGlobal": false,
"private": false,
"license": "MIT",
"dependencies": {
"body-parser": "^1.15.0",
"chip": "0.0.5",
"deasync": "^0.1.4",
"ejs": "^2.4.1",
"express": "^4.13.4",
"extend": "^3.0.0",
"faker": "^3.0.1",
"request": "^2.72.0"
},
"devDependencies": {
"babel-eslint": "^6.0.3",
"eslint": "^2.8.0",
"mocha": "^2.4.5"
}
"name": "node-mock-server",
"version": "0.8.2",
"description": "File based Node API mock server",
"email": "[email protected]",
"author": "Simon Mollweide <[email protected]>",
"url": "https://github.com/smollweide/node-mock-server",
"repository": {
"type": "github",
"url": "https://github.com/smollweide/node-mock-server"
},
"bugs": {
"url": "https://github.com/smollweide/node-mock-server/issues"
},
"scripts": {
"start": "node app.js",
"test": "./node_modules/mocha/bin/mocha ./test/tests.js"
},
"main": "mock-server.js",
"keywords": [
"node",
"npm",
"mock",
"rest",
"rest API",
"json",
"DTO",
"Swagger"
],
"engines": {
"node": ">=0.12.7"
},
"preferGlobal": false,
"private": false,
"license": "MIT",
"dependencies": {
"body-parser": "^1.15.0",
"chip": "0.0.5",
"deasync": "^0.1.4",
"ejs": "^2.4.1",
"express": "^4.13.4",
"extend": "^3.0.0",
"faker": "^3.0.1",
"request": "^2.72.0"
},
"devDependencies": {
"babel-eslint": "^6.0.3",
"eslint": "^2.8.0",
"mocha": "^2.4.5"
}
}

0 comments on commit fc04676

Please sign in to comment.