包含标签 SuperTest 的文章

Jenkins with Grunt

Jenkins

In a nutshell, Jenkins is the leading open source automation server.
Built with Java, it provides hundreds of plugins to support building,
testing, deploying and automation for virtually any project
Jenkins是一个开源软件项目,旨在提供一个开放易用的软件平台,使软件的持续集成变成可能。
……

阅读全文

Http-Header

Header

定义

提供HTTP所需要的信息或发送的信息

HTTP header fields provide required information about the request or response, or about the object sent in the message body.

……

阅读全文

SuperTest-header:Auth设置

SuperTest SuperTest-API测试 Auth分类 Basic:基本身份认证,直接采用:用户名密码 基本用法 1 2 3 4 5 6 it('should receive a status code of 200 with login', function(done) { request(url) .get('/staging') .auth('the-username', 'the-password') .expect(200, done); }); Base64加密 1 .set("Authorization", "basic " + new Buffer("username:password").toString("base64")) Digest:摘要式身份认证 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 request.get('http://some.server.com/').auth('username', 'password', false); // or request.get('http://some.server.com/', { 'auth': { 'user': 'username', 'pass': 'password', 'sendImmediately': false } }); // or request.get('http://some.server.com/').auth(null, null,……

阅读全文

Node.js调用数据库:Mysql

安装Mysql包 npm install mysql 调用 Mysql包 1 var mysql = require('mysql'); 数据库查询 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 var mysql = require('mysql'); var connection = mysql.createConnection({ host : '10.29.10.29', port : 3307, user : 'root', password : '', database : 'emall', //charset : 'UTF8_GENERAL_CI', debug : false }); connection.connect(); connection.query("use emall"); connection.query('select id from users', function(err,results) { if (err) { throw err; } }); connection.end(); 数据库插入 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 var mysql = require('mysql'); var connection = mysql.createConnection({ host : '10.29.10.29', port : 3307, user : 'root', password : '', database……

阅读全文

SuperTest-API测试

什么是SuperTest The motivation with this module is to provide a high-level abstraction for testing HTTP, while still allowing you to drop down to the lower-level API provided by super-agent. 简单说明:用来测试HTTP请求,提供简单的super-agent来实现API请求 安装SuperTest npm安装 官网下载对应的操作系统版本-NPM,下载完成后,直接进行安装即可 cnpm,若翻墙网络比较……

阅读全文