New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ral

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ral - npm Package Compare versions

Comparing version 0.11.0 to 0.11.1

4

lib/mock.js

@@ -37,3 +37,3 @@ /**

ctx.RAL_MOCK_ALL = true;
ctx.RAL_MOCK = null;
ctx.RAL_MOCK = {};
}

@@ -48,3 +48,3 @@ else {

else {
ctx.RAL_MOCK = null;
ctx.RAL_MOCK = {};
}

@@ -51,0 +51,0 @@ ctx.RAL_MOCK_ALL = false;

{
"name": "node-ral",
"version": "0.11.0",
"version": "0.11.1",
"description": "a rpc client for node",

@@ -41,4 +41,4 @@ "main": "index.js",

"devDependencies": {
"request": "2.73.0",
"async": "2.0.0",
"request": "2.74.0",
"async": "2.0.1",
"combined-stream": "1.0.5",

@@ -45,0 +45,0 @@ "formidable": "1.0.17",

@@ -79,2 +79,3 @@ node-ral

var RAL = require('node-ral').RAL;
var ralP = require('node-ral').RALPromise; // 使用Ral的Promise版接口
var path = require('path');

@@ -88,3 +89,3 @@

module.exports = RAL;
module.exports = ralP;
```

@@ -97,6 +98,6 @@

var ral = require('./ral.js');
var ralP = require('./ral.js');
var assert = require('assert');
ral('MAPAPI', {
ralP('MAPAPI', {
data: {

@@ -106,6 +107,6 @@ region: '北京',

}
}).on('data', function (data) {
}).then(function (data) {
assert.equal(data.status, 0);
console.dir(data.results[0]);
}).on('error', function (err) {
}).catch(function (err) {
console.error(err);

@@ -112,0 +113,0 @@ });

/**
* @file node-ral

@@ -208,2 +212,29 @@ * @author hefangshi@baidu.com

it.only('should dont mock anything when RAL_MOCK is null', function (done) {
delete process.env.RAL_MOCK;
ral.init({
confDir: path.join(__dirname, './ral/config'),
mockDir: path.join(__dirname, './ral/mock'),
logger: {
log_path: path.join(__dirname, '../logs'),
app: 'yog-ral'
},
currentIDC: 'tc'
});
// should degrade since POST_QS_SERV's enableMock=true
var req = ral('POST_QS_SERV', {
data: {
msg: 'hi',
name: '何方石'
}
});
req.on('data', function (data) {
done();
});
req.on('error', function (err) {
err.message.should.eql('mock fatal hit');
done();
});
});
});
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