8f047ddb84
Custom inspection with the `inspect` property is deprecated and will not work in Node.js 11 anymore. This fixes it by using the custom inspect symbol where existent and falls back to the old style in case it does not exist.
21 lines
482 B
JavaScript
21 lines
482 B
JavaScript
|
|
'use strict';
|
|
|
|
const assert = require('assert');
|
|
const util = require('util');
|
|
const Koa = require('../..');
|
|
const app = new Koa();
|
|
|
|
describe('app.inspect()', () => {
|
|
it('should work', () => {
|
|
const str = util.inspect(app);
|
|
assert.equal("{ subdomainOffset: 2, proxy: false, env: 'test' }", str);
|
|
});
|
|
|
|
it('should return a json representation', () => {
|
|
assert.deepEqual(
|
|
{ subdomainOffset: 2, proxy: false, env: 'test' },
|
|
app.inspect()
|
|
);
|
|
});
|
|
});
|