Skip to content

Commit

Permalink
test: add path containing createRequire test case
Browse files Browse the repository at this point in the history
  • Loading branch information
yamachu committed Jan 21, 2025
1 parent 0489fc0 commit 83fe515
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 83fe515

Please sign in to comment.