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.0.1 to 3.1.0

5

History.md
3.1.0 / 2017-03-02
==================
* feat: use framework instead of customEgg (#31)
3.0.1 / 2017-02-22

@@ -3,0 +8,0 @@ ==================

2

index.js

@@ -18,3 +18,3 @@ 'use strict';

* - {Object} plugins - Tustom you plugins
* - {String} customEgg - The directory of the egg framework
* - {String} framework - The directory of the egg framework
* - {Boolean} [true] cache - Cache application based on baseDir

@@ -21,0 +21,0 @@ * - {Boolean} [true] coverage - Swtich on process coverage, but it'll be slower

@@ -58,3 +58,3 @@ 'use strict';

debug('get clusterPort %s', this.options.clusterPort);
const egg = require(this.options.customEgg);
const egg = require(this.options.framework);

@@ -61,0 +61,0 @@ const Agent = egg.Agent;

@@ -48,3 +48,3 @@ 'use strict';

* - {Object} plugins - Tustom you plugins
* - {String} customEgg - The directory of the egg framework
* - {String} framework - The directory of the egg framework
* - {Boolean} [cache=true] - Cache application based on baseDir

@@ -51,0 +51,0 @@ * - {Boolean} [coverage=true] - Swtich on process coverage, but it'll be slower

@@ -6,3 +6,2 @@ 'use strict';

const debug = require('debug')('mm');
const assert = require('assert');
const utils = require('egg-utils');

@@ -32,20 +31,13 @@

let framework = options.framework || options.customEgg;
// test for framework
if (options.customEgg === true) {
options.customEgg = process.cwd();
if (framework === true) {
framework = process.cwd();
// diable plugin test when framwork test
options.plugin = false;
} else {
// it will throw when framework is not found
framework = utils.getFrameworkPath({ framework, baseDir: options.baseDir });
}
if (!options.customEgg) {
options.customEgg = utils.getFrameworkOrEggPath(options.baseDir);
if (!options.customEgg) {
// try to resolve egg
try {
options.customEgg = path.dirname(require.resolve('egg'));
} catch (_) {
// can't find egg
}
}
}
assert(options.customEgg, 'options.customEgg is required');
options.customEgg = options.framework = framework;

@@ -52,0 +44,0 @@ const plugins = options.plugins = options.plugins || {};

{
"name": "egg-mock",
"version": "3.0.1",
"version": "3.1.0",
"eggPlugin": {

@@ -29,3 +29,3 @@ "name": "egg-mock"

"detect-port": "^1.1.0",
"egg-utils": "^1.1.0",
"egg-utils": "^2.1.0",
"get-ready": "^2.0.1",

@@ -36,11 +36,12 @@ "is-type-of": "^1.0.0",

"mm": "^2.1.0",
"rimraf": "^2.5.4"
"rimraf": "^2.6.1"
},
"devDependencies": {
"autod": "^2.7.1",
"egg": "^0.12.0",
"egg-bin": "^2.0.2",
"egg-ci": "^1.1.0",
"eslint": "^3.15.0",
"egg": "^1.0.0-rc.2",
"egg-bin": "^2.2.3",
"egg-ci": "^1.3.0",
"eslint": "^3.16.1",
"eslint-config-egg": "^3.2.0",
"mkdirp": "^0.5.1",
"pedding": "^1.1.0",

@@ -47,0 +48,0 @@ "sdk-base": "^3.0.1",

@@ -78,3 +78,3 @@ # egg-mock

customEgg is optional, it's `node_modules/egg` by default.
framework is optional, it's `node_modules/egg` by default.

@@ -85,3 +85,3 @@ ```js

baseDir: 'apps/demo',
customEgg: true,
framework: true,
});

@@ -113,3 +113,3 @@ return app.ready();

baseDir: 'apps/demo',
customEgg: path.join(__dirname, 'node_modules/aliyun-egg'),
framework: path.join(__dirname, 'node_modules/aliyun-egg'),
});

@@ -125,3 +125,3 @@ return app.ready();

baseDir: 'apps/demo',
customEgg: path.join(__dirname, 'node_modules/framework-b'),
framework: path.join(__dirname, 'node_modules/framework-b'),
});

@@ -236,3 +236,3 @@ return app.ready();

#### customEgg {String/Boolean}
#### framework {String/Boolean}

@@ -244,3 +244,3 @@ The directory of framework

baseDir: 'apps/demo',
customEgg: path.join(__dirname, 'fixtures/egg'),
framework: path.join(__dirname, 'fixtures/egg'),
})

@@ -247,0 +247,0 @@ ```

Sorry, the diff of this file is not supported yet

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