summaryrefslogtreecommitdiff
path: root/cli/tests/node_compat/test/parallel/test-buffer-alloc.js
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2023-12-11 19:17:36 +0900
committerGitHub <noreply@github.com>2023-12-11 19:17:36 +0900
commite9ab9ba9f0c47f01ebc41f3013b3f78962aaeca7 (patch)
treed14e6f2c4074bf40f44d4a3bf8b12ba5c5e7c8b8 /cli/tests/node_compat/test/parallel/test-buffer-alloc.js
parent02e138dca9c9fd79f47d352114b45b21dbb2b2ba (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-alloc.js')
-rw-r--r--cli/tests/node_compat/test/parallel/test-buffer-alloc.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/tests/node_compat/test/parallel/test-buffer-alloc.js b/cli/tests/node_compat/test/parallel/test-buffer-alloc.js
index dee9128a8..bb0af6456 100644
--- a/cli/tests/node_compat/test/parallel/test-buffer-alloc.js
+++ b/cli/tests/node_compat/test/parallel/test-buffer-alloc.js
@@ -9,7 +9,7 @@
const common = require('../common');
const assert = require('assert');
-// const vm = require('vm');
+const vm = require('vm');
const SlowBuffer = require('buffer').SlowBuffer;
@@ -1154,11 +1154,11 @@ assert.throws(() => {
// Regression test to verify that an empty ArrayBuffer does not throw.
Buffer.from(new ArrayBuffer());
-// TODO(kt3k): Enable this test when vm.runInNewContext is available
+
// Test that ArrayBuffer from a different context is detected correctly.
-// const arrayBuf = vm.runInNewContext('new ArrayBuffer()');
-// Buffer.from(arrayBuf);
-// Buffer.from({ buffer: arrayBuf });
+const arrayBuf = vm.runInNewContext('new ArrayBuffer()');
+Buffer.from(arrayBuf);
+Buffer.from({ buffer: arrayBuf });
assert.throws(() => Buffer.alloc({ valueOf: () => 1 }),
/"size" argument must be of type number/);