67630217ae
* Fix context.inspect when called on the prototype Fixes #837 * Add tests
20 lines
536 B
JavaScript
20 lines
536 B
JavaScript
|
|
'use strict';
|
|
|
|
const prototype = require('../../lib/context');
|
|
const assert = require('assert');
|
|
const context = require('../helpers/context');
|
|
|
|
describe('ctx.inspect()', () => {
|
|
it('should return a json representation', () => {
|
|
const ctx = context();
|
|
const toJSON = ctx.toJSON(ctx);
|
|
|
|
assert.deepEqual(toJSON, ctx.inspect());
|
|
});
|
|
|
|
// console.log(require.cache) will call prototype.inspect()
|
|
it('should not crash when called on the prototype', () => {
|
|
assert.deepEqual(prototype, prototype.inspect());
|
|
});
|
|
});
|