Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect usage of assert.deepStrictEqual in benchmark script #125

Closed
Nevro opened this issue Dec 31, 2024 · 3 comments · Fixed by #126
Closed

Incorrect usage of assert.deepStrictEqual in benchmark script #125

Nevro opened this issue Dec 31, 2024 · 3 comments · Fixed by #126

Comments

@Nevro
Copy link

Nevro commented Dec 31, 2024

If values are equal assert.deepStrictEqual return is undefined witch is converted to falsy return.

 const packages = {
   'assert.deepStrictEqual': (a, b) => {
     try {
-      return assertDeepStrictEqual(a, b);
-    } catch (e) {
+      return assertDeepStrictEqual(a, b) === undefined;
+    } catch {
       return false;
     }
   },
@planttheidea
Copy link
Owner

Has been resolved as-of 5.1.0.

@Nevro
Copy link
Author

Nevro commented Jan 17, 2025

Deno:

error: Relative import path "assert" not prefixed with / or ./ or ../
  hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:assert").
    at file:///storage/git/fast-equals/benchmark/index.js:3:58

@planttheidea
Copy link
Owner

planttheidea commented Jan 18, 2025

@Nevro I created #140 from the post above, and fixed it with #141 .

In the future, rather than piggybacking on a closed issue, please create a new issue. I know both relate to usage of assert in benchmarks, but the problems related to assert were completely unrelated, and by having dedicated issue tracking it helps with visibility and resolution mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants