summaryrefslogtreecommitdiff
path: root/cli/tests/node_compat/test/parallel/test-util-inspect.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-util-inspect.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-util-inspect.js')
-rw-r--r--cli/tests/node_compat/test/parallel/test-util-inspect.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/cli/tests/node_compat/test/parallel/test-util-inspect.js b/cli/tests/node_compat/test/parallel/test-util-inspect.js
index c875b9c6a..17fafed2e 100644
--- a/cli/tests/node_compat/test/parallel/test-util-inspect.js
+++ b/cli/tests/node_compat/test/parallel/test-util-inspect.js
@@ -33,8 +33,7 @@ const assert = require('assert');
// const { internalBinding } = require('internal/test/binding');
// const JSStream = internalBinding('js_stream').JSStream;
const util = require('util');
-// TODO(wafuwafu13): Implement 'vm'
-// const vm = require('vm');
+const vm = require('vm');
// TODO(wafuwafu13): Implement 'v8'
// const v8 = require('v8');
// TODO(wafuwafu13): Implement 'internal/test/binding'
@@ -566,16 +565,15 @@ assert.strictEqual(
'2010-02-14T11:48:40.000Z { aprop: 42 }');
}
-// TODO(wafuwafu13): Implement 'vm'
-// // Test the internal isDate implementation.
-// {
-// const Date2 = vm.runInNewContext('Date');
-// const d = new Date2();
-// const orig = util.inspect(d);
-// Date2.prototype.foo = 'bar';
-// const after = util.inspect(d);
-// assert.strictEqual(orig, after);
-// }
+// Test the internal isDate implementation.
+{
+ const Date2 = vm.runInNewContext('Date');
+ const d = new Date2();
+ const orig = util.inspect(d);
+ Date2.prototype.foo = 'bar';
+ const after = util.inspect(d);
+ assert.strictEqual(orig, after);
+}
// Test positive/negative zero.
assert.strictEqual(util.inspect(0), '0');