2018-10-24 00:39:02 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-10-07 17:29:07 +08:00
|
|
|
require('../../support/test-helper');
|
2015-09-15 01:07:53 +08:00
|
|
|
|
|
|
|
var assert = require('assert');
|
2019-10-07 17:29:07 +08:00
|
|
|
var ProfilerProxy = require('../../../lib/stats/profiler-proxy');
|
2015-09-15 01:07:53 +08:00
|
|
|
|
2019-10-22 01:07:24 +08:00
|
|
|
describe('profiler', function () {
|
|
|
|
it('Profiler is null in ProfilerProxy when profiling is not enabled', function () {
|
|
|
|
var profilerProxy = new ProfilerProxy({ profile: false });
|
2019-10-22 01:41:03 +08:00
|
|
|
assert.strictEqual(profilerProxy.profiler, null);
|
2015-09-15 01:07:53 +08:00
|
|
|
});
|
|
|
|
|
2019-10-22 01:07:24 +08:00
|
|
|
it('Profiler is NOT null in ProfilerProxy when profiling is enabled', function () {
|
|
|
|
var profilerProxy = new ProfilerProxy({ profile: true });
|
2019-10-22 02:05:51 +08:00
|
|
|
assert.notStrictEqual(profilerProxy.profiler, null);
|
2015-09-15 01:07:53 +08:00
|
|
|
});
|
|
|
|
});
|