c64lives7mo ago

Possible issue with re-export compatibility with Node

In https://github.com/japa/runner/issues/35, I have described an issue where Deno seems to be incompatible with the Japa test runner (which uses a plugin-style design in which a TestContext class is augmented with additional properties via Object.defineProperty). It could have something to do with re-exports somehow working differently in Deno, an edge-case? If someone has time to take a quick look it would be amazing.
Issues · japa/runner
Standalone test runner built on top of japa core. Contribute to japa/runner development by creating an account on GitHub.
1 Reply
Deno AI Helper
Deno AI Helper7mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the information you've provided, it's possible that the issue might be related to differences in module resolution or the way that Deno handles imports and exports compared to Node.js. Deno is designed to be compatible with the ECMAScript modules (ESM) specification, and there are some known differences in how Node.js and Deno handle modules. For instance, Deno does not support Node's require() syntax for importing modules and instead uses the standard ESM import syntax. Additionally, Deno's module resolution is URL-based, which can lead to differences in behavior when compared to Node's file-based module resolution. Without more specific details, it's difficult to pinpoint the exact cause of the issue you're experiencing. However, if the problem is related to Object.defineProperty and the augmentation of the TestContext class, it's worth noting that Deno should support standard JavaScript operations like Object.defineProperty. If there's a discrepancy in behavior, it could be due to the way the modules are being imported or exported in the context of Deno. Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. It might be helpful to compare the module resolution and export patterns used in your code with Deno's documented behavior regarding ECMAScript modules to see if there are any obvious discrepancies. If the issue persists, you may want to reach out to the Deno community or the maintainers of the Japa test runner for further assistance.