theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 310 forks source link

Failing testcase on assert.strictEqual with circular parameter does not appear in reporter #1167

Open rhpijnacker opened 4 years ago

rhpijnacker commented 4 years ago

When I use assert.strictEqual in a test case and pass in an object with a circular reference, then the test case is not logged by the reporters (console, html) as a failing test case. It is listed as failing in the overview, though (1/1 tests failed).

This test case demonstrates the problem:

const { registerSuite } = intern.getInterface('object');
const { assert } = intern.getPlugin('chai');
define(['module'], function(module) {
  registerSuite(module.id, {
    tests: {
      'Test does not appear in reporter'() {
        const a = { b: null };
        const b = { a: a };
        a.b = b;
        assert.strictEqual(a, null);
      }
    }
  });
});

Environment

Intern version: 4.8.3 Chrome: v83

SachsKaylee commented 2 years ago

Hello, we are also currently facing this issue. This is due to the serialization failing in this line: https://github.com/theintern/intern/blob/4ba563ed5557d55f1f44c163b95feb16b211421a/src/lib/channels/WebSocket.ts#L62

Our data structures contain a lot of circular data so removing them for the test won't be a realistic option. Are there any plans for this issue?

Thank you for your time!