You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why assert.deepStrictEqual() is not used instead of equalObjects?
Second, within the module lib/jsonquery.js, all local functions are invoked using the keyword this, i.e., assimilating the module as an object to resolve local references. This appears to be only required by the fact that the tests in test/test_jsonquery.js rely on sinon stubs which indeed do not support local function calls. But there is a workaround (using rewire) that can be implemented in the test script and avoids modifying the tested module.
With the above code, the call to classSpecifier within classDefinition can be made directly, without this.classSpecifier.
Similarly, modifying each unit test with the above pattern enables getting rid of this in all function calls within lib/jsonquery.js.
The text was updated successfully, but these errors were encountered:
This ticket covers two issues.
First, there seems to be a bug in the function
equalObjects
defined intest/test_jsonquery.js
and used in all unit tests.Whereas
Why
assert.deepStrictEqual()
is not used instead ofequalObjects
?Second, within the module
lib/jsonquery.js
, all local functions are invoked using the keywordthis
, i.e., assimilating the module as an object to resolve local references. This appears to be only required by the fact that the tests intest/test_jsonquery.js
rely onsinon
stubs which indeed do not support local function calls. But there is a workaround (usingrewire
) that can be implemented in the test script and avoids modifying the tested module.With the above code, the call to
classSpecifier
withinclassDefinition
can be made directly, withoutthis.classSpecifier
.Similarly, modifying each unit test with the above pattern enables getting rid of
this
in all function calls withinlib/jsonquery.js
.The text was updated successfully, but these errors were encountered: