0.0.6 • Published 5 years ago
check-rs-json v0.0.6
check-rs-json
BASE ON CONFIG MOCHA TEST PLUGIN
About
Depending on the configurable API testing framework, no coding, just config
Example
git clone https://github.com/TimLiu1/check-rs-json.git
npm i
cd server.js
mocha test/
Example
Quick Study
const request = require('supertest');
const express = require('express');
const app = express();
app.get('/user', function(req, res) {
res.status(200).json({ name: 'john' });
});
request(app)
.get('/user')
.expect('Content-Type', /json/)
.expect('Content-Length', '15')
.expect(200)
.end(function(err, res) {
if (err) throw err;
});