diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2023-12-11 19:17:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 19:17:36 +0900 |
commit | e9ab9ba9f0c47f01ebc41f3013b3f78962aaeca7 (patch) | |
tree | d14e6f2c4074bf40f44d4a3bf8b12ba5c5e7c8b8 /cli/tests/node_compat/test/parallel/test-buffer-bytelength.js | |
parent | 02e138dca9c9fd79f47d352114b45b21dbb2b2ba (diff) |
test(ext/node): enable some compat test cases (#21532)
This change uncomments Node.js compat test cases which was enabled by the
addition of `vm.runInNewContext`
https://github.com/denoland/deno/pull/21527
Diffstat (limited to 'cli/tests/node_compat/test/parallel/test-buffer-bytelength.js')
-rw-r--r-- | cli/tests/node_compat/test/parallel/test-buffer-bytelength.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js b/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js index 7fb62c78f..4f10596a2 100644 --- a/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js +++ b/cli/tests/node_compat/test/parallel/test-buffer-bytelength.js @@ -10,7 +10,7 @@ const common = require('../common'); const assert = require('assert'); const SlowBuffer = require('buffer').SlowBuffer; -// const vm = require('vm'); +const vm = require('vm'); [ [32, 'latin1'], @@ -125,11 +125,9 @@ assert.strictEqual(Buffer.byteLength('Il était tué', 'utf8'), 14); assert.strictEqual(Buffer.byteLength('Il était tué', encoding), 24); }); -// TODO(Soremwar) -// Enable once vm module is available // Test that ArrayBuffer from a different context is detected correctly -// const arrayBuf = vm.runInNewContext('new ArrayBuffer()'); -// assert.strictEqual(Buffer.byteLength(arrayBuf), 0); +const arrayBuf = vm.runInNewContext('new ArrayBuffer()'); +assert.strictEqual(Buffer.byteLength(arrayBuf), 0); // Verify that invalid encodings are treated as utf8 for (let i = 1; i < 10; i++) { |