From e9ab9ba9f0c47f01ebc41f3013b3f78962aaeca7 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Mon, 11 Dec 2023 19:17:36 +0900 Subject: 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 --- cli/tests/node_compat/test/parallel/test-buffer-alloc.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cli/tests/node_compat/test/parallel/test-buffer-alloc.js') 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/); -- cgit v1.2.3