4b1a1da652
closes #553 Update test: application -> use() should throw if not a function Fix lint Use arrow function Refactor test using arrow function Remove non mandatory brackets fix for merge Fix: missing refactor after merge Use arrow function for old generator
31 lines
674 B
JavaScript
31 lines
674 B
JavaScript
|
|
'use strict';
|
|
|
|
const request = require('../helpers/context').request;
|
|
const assert = require('assert');
|
|
|
|
describe('req.inspect()', () => {
|
|
describe('with no request.req present', () => {
|
|
it('should return null', () => {
|
|
const req = request();
|
|
req.method = 'GET';
|
|
delete req.req;
|
|
assert(null == req.inspect());
|
|
});
|
|
});
|
|
|
|
it('should return a json representation', () => {
|
|
const req = request();
|
|
req.method = 'GET';
|
|
req.url = 'example.com';
|
|
req.header.host = 'example.com';
|
|
|
|
req.inspect().should.eql({
|
|
method: 'GET',
|
|
url: 'example.com',
|
|
header: {
|
|
host: 'example.com'
|
|
}
|
|
});
|
|
});
|
|
});
|