1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 23:34:47 -05:00
denoland-deno/cli/tests/unit_node
Marvin Hagemeister 8c051dbd1a
fix(ext/node): add missing _preloadModules hook (#18447)
This internal node hook is used by libraries such as `ts-node` when used
as a require hook `node -r ts-node/register`. That combination is often
used with test frameworks like `mocha` or `jasmine`.

We had a reference to `Module._preloadModules` in our code, but the
implementation was missing. While fixing this I also noticed that the
`fakeParent` module that we create internally always threw because of
the `pathDirname` check on the module id in the constructor of `Mdoule`.
So this code path was probably broken for a while.

```txt
✖ ERROR: Error: Empty filepath.
    at pathDirname (ext:deno_node/01_require.js:245:11)
    at new Module (ext:deno_node/01_require.js:446:15)
    at Function.Module._resolveFilename (ext:deno_node/01_require.js:754:28)
    at Function.resolve (ext:deno_node/01_require.js:1015:19)
```
2023-03-27 21:54:22 +02:00
..
_fs test(ext/node): port _fs tests from std/node (#18262) 2023-03-20 01:10:39 +09:00
internal test(ext/node): Port crypto tests from std/node (#18382) 2023-03-26 10:03:10 +00:00
testdata fix(ext/node): add missing _preloadModules hook (#18447) 2023-03-27 21:54:22 +02:00
_test_utils.ts test(ext/node): port _fs tests from std/node (#18262) 2023-03-20 01:10:39 +09:00
async_hooks_test.ts chore: add tests for node:async_hooks (#18004) 2023-03-17 18:53:57 +01:00
child_process_test.ts test: ignore flaky node:child_process tests (#18360) 2023-03-22 18:39:13 +00:00
crypto_cipher_test.ts fix(ext/node): add aes-128-ecb algorithm support (#18412) 2023-03-25 15:42:07 +09:00
crypto_hash.ts fix(ext/node): resource leak in createHmac (#18229) 2023-03-16 22:25:12 +01:00
crypto_key.ts feat(ext/node): implement crypto.createSecretKey (#18413) 2023-03-24 14:13:26 +00:00
fs_test.ts fix(ext/node): implement "ascii" encoding for node:fs writeFile() (#18097) 2023-03-16 12:16:03 +09:00
module_test.ts fix(ext/node): add missing _preloadModules hook (#18447) 2023-03-27 21:54:22 +02:00
process_test.ts feat(test): print pending tests on sigint (#18246) 2023-03-25 21:32:11 +02:00
querystring_test.ts test(ext/node): add querystring_test.ts and readline_test.ts (#18256) 2023-03-19 19:49:11 +09:00
readline_test.ts test(ext/node): add querystring_test.ts and readline_test.ts (#18256) 2023-03-19 19:49:11 +09:00
tls_test.ts test(ext/node): add tls_test (#17871) 2023-02-23 12:27:29 +09:00
tty_test.ts test(ext/node): add tty_test and util_test (#17868) 2023-02-23 12:28:19 +09:00
util_test.ts refactor(ext/node): Use Deno.inspect (#17960) 2023-03-23 10:01:07 -04:00
v8_test.ts feat(ext/node): implement node:v8 (#17806) 2023-02-17 18:48:09 +05:30