Skip to content

Commit 76b4290

Browse files
committed
Fix legacy require
1 parent ef69175 commit 76b4290

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
11.0.1 / 2021-12-01
2+
------------------
3+
- Fix legacy require
4+
15
11.0.0 / 2021-11-25
26
------------------
37
- Update to Electron 16

lib/mocha.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ const {
2020
const cwd = process.cwd()
2121

2222
const handleLegacyRequires = async (mods) => {
23-
for (let mod of mods) {
24-
if (existsSync(mod, { cwd }) || existsSync(`${mod}.js`, { cwd })) {
25-
mod = resolve(mod)
23+
if (mods) {
24+
for (let mod of mods) {
25+
if (existsSync(mod, { cwd }) || existsSync(`${mod}.js`, { cwd })) {
26+
mod = resolve(mod)
27+
}
28+
require(mod)
2629
}
27-
require(mod)
2830
}
2931
}
3032

0 commit comments

Comments
 (0)