Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

egg-mock

Package Overview
Dependencies
Maintainers
5
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-mock - npm Package Compare versions

Comparing version 3.11.0 to 3.12.0

7

app/extend/application.js

@@ -296,2 +296,7 @@ 'use strict';

}
function matchUrl(url) {
if (url === mockUrl) return true;
if (mockUrl instanceof RegExp && url.match(mockUrl)) return true;
return false;
}

@@ -303,3 +308,3 @@ // support generator rather than callback and promise

opt.headers = opt.headers || {};
if (url === mockUrl && matchMethod(opt.method)) {
if (matchUrl(url) && matchMethod(opt.method)) {
const response = {

@@ -306,0 +311,0 @@ status: mockResult.status,

3.12.0 / 2017-09-12
==================
**others**
* [[`25a0e28`](http://github.com/eggjs/egg-mock/commit/25a0e28e85209ec08a593b38cd434ed389ef8887)] - feat(mockHttpclient): use Regular Expression for matching url (#57) (Haoliang Gao <<sakura9515@gmail.com>>)
3.11.0 / 2017-09-11

@@ -3,0 +9,0 @@ ==================

2

package.json
{
"name": "egg-mock",
"version": "3.11.0",
"version": "3.12.0",
"eggPlugin": {

@@ -5,0 +5,0 @@ "name": "egg-mock"

@@ -375,2 +375,12 @@ # egg-mock

You can also use Regular Expression for matching url.
```js
app.mockHttpclient(/\/users\/[a-z]$/i, {
data: {
name: 'egg',
},
});
```
## Bootstrap

@@ -377,0 +387,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc