File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -264,8 +264,14 @@ class TestContext {
264264 } ;
265265 } ) ;
266266
267- // assert.ok needs it's own function, as it checks the stack
268- // trace to provide more descriptive errors.
267+ // TODO(RedYetiDev): This is a hack. It should be replaced with better handling in
268+ // internal/assert/util.js
269+ //
270+ // The innerOk function receives a reference to the userland function that invoked it
271+ // to correctly generate the stack trace. However, when each assert method is wrapped
272+ // (for test planning purposes), the reference passed to innerOk no longer points to
273+ // the original userland function. To address this issue, the ok function is implemented
274+ // below without using the wrapper, allowing innerOk to receive the correct reference.
269275 function ok ( ...args ) {
270276 if ( plan !== null ) {
271277 plan . actual ++ ;
You can’t perform that action at this time.
0 commit comments