Skip to content

Failing test: test-assert #122

Closed
Closed

Description

@targos
=== release test-assert ===
Path: parallel/test-assert
/home/mzasso/git/nodejs/canary/test/common/index.js:621
        throw new assert.AssertionError({
        ^

AssertionError [ERR_ASSERTION]: Expected "actual" to be reference-equal to "expected":
+ actual - expected

  Comparison {
    code: 'ERR_ASSERTION',
+   message: 'false == true',
-   message: 'The expression evaluated to a falsy value:\n\n  assert(1 === 2)\n',
    type: [Function: AssertionError]
  }
    at new AssertionError (internal/assert/assertion_error.js:424:11)
    at Object.innerFn (/home/mzasso/git/nodejs/canary/test/common/index.js:621:15)
    at expectedException (assert.js:650:26)
    at expectsError (assert.js:775:3)
    at Function.throws (assert.js:824:3)
    at Object.expectsError (/home/mzasso/git/nodejs/canary/test/common/index.js:633:12)
    at Object.<anonymous> (/home/mzasso/git/nodejs/canary/test/parallel/test-assert.js:913:8)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1224:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: [AssertionError],
  expected: [Object],
  operator: 'common.expectsError'
}
Command: out/Release/node --expose-internals /home/mzasso/git/nodejs/canary/test/parallel/test-assert.js

Activity

  1. BridgeAR commented on Dec 4, 2019

    @BridgeAR
    Member

    Just a guess: I believe the V8 team considered removing stackframe.getFunction(). That function is necessary for this test to pass.

  2. targos commented on Dec 4, 2019

    @targos
    MemberAuthor

    getFunction still returns a function. The problem seems to be that it returns a reference to the assert.ok function instead of the function being tested (created with new Function())

  3. targos commented on Dec 4, 2019

    @targos
    MemberAuthor

    This is where it fails:

    // Works in eval.
    common.expectsError(
    () => new Function('assert', 'assert(1 === 2);')(assert),
    {
    code: 'ERR_ASSERTION',
    type: assert.AssertionError,
    message: 'The expression evaluated to a falsy value:\n\n assert(1 === 2)\n'
    }
    );

  4. BridgeAR commented on Dec 4, 2019

    @BridgeAR
    Member

    The problem seems to be that it returns a reference to the assert.ok function instead of the function being tested

    That sounds like a breaking change? I guess it could also something that was not intentional and regressed?

  5. targos commented on Dec 4, 2019

    @targos
    MemberAuthor

    /cc @nodejs/v8

  6. ryzokuken commented on Dec 4, 2019

    @ryzokuken

    @targos I guess it makes sense to open an issue on the V8 issue tracker?

  7. targos commented on Dec 4, 2019

    @targos
    MemberAuthor

    @ryzokuken sure, would you like to do it? Best would be to have a repro using d8.

  8. ryzokuken commented on Dec 5, 2019

    @ryzokuken

    @targos on it.

  9. targos commented on Dec 6, 2019

    @targos
    MemberAuthor

    Actually the solution is to revert nodejs/node@5981fb7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions