koa-lite/test/request/inspect.js
broucz 4b1a1da652 test: switch all functions to arrow functions
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
2015-11-02 11:22:05 -08:00

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'
}
});
});
});