Skip to content

Commit

Permalink
test: added test that uses multibyte for path and resolves modules
Browse files Browse the repository at this point in the history
  • Loading branch information
yamachu committed Jan 23, 2025
1 parent d978610 commit 2b7400a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-module-create-require-multibyte.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

require('../common');
const fixtures = require('../common/fixtures');
const assert = require('assert');

// This test ensures that the module can be resolved
// even if the path given to createRequire contains multibyte characters.

const { createRequire } = require('module');

const u = fixtures.fileURL('あ.js');

const reqToo = createRequire(u);
assert.deepStrictEqual(reqToo('./experimental'), { ofLife: 42 });

0 comments on commit 2b7400a

Please sign in to comment.