File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
graal-js/src/com.oracle.truffle.js.test/src/com/oracle/truffle/js/test/builtins Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2019, 2022 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2019, 2023 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * The Universal Permissive License (UPL), Version 1.0
@@ -476,6 +476,19 @@ public void testCustomNodeBuiltin() {
476476 }
477477 }
478478
479+ @ Test
480+ public void testCustomNodeBuiltinNodePrefix () {
481+ Path root = getTestRootFolder ();
482+ Map <String , String > options = new HashMap <>();
483+ options .put (COMMONJS_REQUIRE_NAME , "true" );
484+ options .put (COMMONJS_REQUIRE_CWD_NAME , root .toAbsolutePath ().toString ());
485+ options .put (COMMONJS_CORE_MODULES_REPLACEMENTS_NAME , "util:./module" );
486+ try (Context cx = testContext (options )) {
487+ Value js = cx .eval (ID , "require('node:util').foo" );
488+ Assert .assertEquals (42 , js .asInt ());
489+ }
490+ }
491+
479492 @ Test
480493 public void testNotNodeBuiltin () {
481494 Path root = getTestRootFolder ();
You can’t perform that action at this time.
0 commit comments