This repository was archived by the owner on Apr 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ module.exports = Debuglet;
9696 */
9797function Debuglet ( debug , config ) {
9898 /** @private {object} */
99- this . config_ = this . normalizeConfig_ ( config ) ;
99+ this . config_ = Debuglet . normalizeConfig_ ( config ) ;
100100
101101 /** @private {Debug} */
102102 this . debug_ = debug ;
@@ -139,7 +139,7 @@ function Debuglet(debug, config) {
139139
140140util . inherits ( Debuglet , EventEmitter ) ;
141141
142- Debuglet . prototype . normalizeConfig_ = function ( config ) {
142+ Debuglet . normalizeConfig_ = function ( config ) {
143143 var envConfig = {
144144 logLevel : process . env . GCLOUD_DEBUG_LOGLEVEL ,
145145 serviceContext : {
Original file line number Diff line number Diff line change @@ -59,17 +59,15 @@ describe('Debuglet', function() {
5959 afterEach ( function ( ) { nock . cleanAll ( ) ; } ) ;
6060
6161 it ( 'should merge config correctly' , function ( ) {
62- var debug = require ( '../src/debug.js' ) ( ) ;
63-
6462 var testValue = 2 * defaultConfig . capture . maxExpandFrames ;
6563 var config = { capture : { maxExpandFrames : testValue } } ;
66- var debuglet = new Debuglet ( debug , config ) ;
6764
65+ var mergedConfig = Debuglet . normalizeConfig_ ( config ) ;
66+ var compareConfig = Debuglet . normalizeConfig_ ( ) ;
6867 // The actual config should be exactly defaultConfig with only
6968 // maxExpandFrames adjusted.
70- var compareConfig = extend ( true , { } , defaultConfig ) ;
7169 compareConfig . capture . maxExpandFrames = testValue ;
72- assert . deepEqual ( debuglet . config_ , compareConfig ) ;
70+ assert . deepEqual ( mergedConfig , compareConfig ) ;
7371 } ) ;
7472
7573 it ( 'should not start when projectId is not available' , function ( done ) {
You can’t perform that action at this time.
0 commit comments