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

bluecat

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluecat - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

80

lib/cli.js

@@ -6,7 +6,81 @@ // Bluecat client command line tool

var Path = require('path');
var Inquirer = require('inquirer');
var Exec = require('child_process').exec;
var argv = require('yargs')
.usage('Usage: $0 <config|api>')
.demand(1)
.argv;
var dir = Path.join(__dirname, '../../../config');
var questions = [
{
type: 'input',
name: 'project_name',
message: 'What\'s the name of your project',
//default: 'Service test'
}
];
if (!Fs.existsSync(dir)){
Fs.mkdirSync(dir);
if(argv._[0] === 'config') {
console.log('\n===========================================');
console.log('Bluecat Test Framework Configuration Helper');
console.log('===========================================\n');
Inquirer.prompt( questions, function( answers ) {
// console.log( JSON.stringify(answers, null, ' ') );
// setting up config dir
var dir = Path.join(process.cwd(), 'config');
if (!Fs.existsSync(dir)){
Fs.mkdirSync(dir);
}
var content = {};
content[answers.project_name] = {
get:{
schema: "http",
method: ["GET"],
},
post:{
schema: "http",
method: ["POST"],
}
};
Fs.appendFileSync(Path.join(dir, 'api.json'), JSON.stringify(content, null, 2) + ',\n');
content = {
env: "production",
proxy: null,
server: {
host: "http://httpbin.org/",
}
};
Fs.appendFileSync(Path.join(dir, 'default.json'), JSON.stringify(content, null, 2) + ',\n');
// setting up test dir
dir = Path.join(process.cwd(), 'test');
if (!Fs.existsSync(dir)){
Fs.mkdirSync(dir);
}
var testContent = `
var Config = require('config');
var Bluecat = require('bluecat');
var api = Bluecat.Api('pangaea');
service = new Bluecat.ServiceSync(api, Config.server.host);
service.setProxy(Config.proxy);
exports.${answers.project_name} = service;
`;
Fs.appendFileSync(Path.join(dir, 'test.js'), JSON.stringify(content, null, 2) + ',\n');
// setting up root dir
var content = {
name: answers.project_name,
version: '0.0.1',
dependencies: {
}
};
Fs.appendFileSync(Path.join(process.cwd(), 'package.json'), JSON.stringify(conntent, null, 2) + ',\n');
var output = Exec('npm install bluecat chai config mocha mocha-espresso mocha-multi --save');
});
}

2

lib/index.js
exports.ServiceSync = require('./service.gen.sync');
exports.ServiceAsync = require('./service.gen.async');
exports.Api = require('./service.api');
exports.version = '0.3.6';
exports.version = '0.3.7';
{
"name": "bluecat",
"version": "0.3.6",
"version": "0.3.7",
"author": "ccy <ccy.chenchaoyi@gmail.com>",

@@ -27,5 +27,7 @@ "description": "Generic REST API Test Framework",

"hoek": "^2.16.3",
"inquirer": "^0.11.0",
"path": "^0.12.7",
"promise": "^7.0.4",
"request": "2.67.0"
"request": "2.67.0",
"yargs": "^3.31.0"
},

@@ -32,0 +34,0 @@ "scripts": {

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