Skip to content

Commit 4f0cf47

Browse files
yamachumarco-ippolito
authored andcommitted
test: add test that uses multibyte for path and resolves modules
PR-URL: #56696Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 3bc8d27 commit 4f0cf47

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ofLife": 42
3+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
require('../common');
4+
constfixtures=require('../common/fixtures');
5+
constassert=require('assert');
6+
7+
// This test ensures that the module can be resolved
8+
// even if the path given to createRequire contains multibyte characters.
9+
10+
const{ createRequire }=require('module');
11+
12+
{
13+
constu=fixtures.fileURL('あ.js');
14+
15+
constreqToo=createRequire(u);
16+
assert.deepStrictEqual(reqToo('./experimental'),{ofLife: 42});
17+
}
18+
19+
{
20+
constu=fixtures.fileURL('copy/utf/新建文件夹/index.js');
21+
22+
constreqToo=createRequire(u);
23+
assert.deepStrictEqual(reqToo('./experimental'),{ofLife: 42});
24+
}

0 commit comments

Comments
(0)