Skip to content

Commit

Permalink
Fix legacy require
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Dec 1, 2021
1 parent ef69175 commit 76b4290
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
11.0.1 / 2021-12-01
------------------
- Fix legacy require

11.0.0 / 2021-11-25
------------------
- Update to Electron 16
Expand Down
10 changes: 6 additions & 4 deletions lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ const {
const cwd = process.cwd()

const handleLegacyRequires = async (mods) => {
for (let mod of mods) {
if (existsSync(mod, { cwd }) || existsSync(`${mod}.js`, { cwd })) {
mod = resolve(mod)
if (mods) {
for (let mod of mods) {
if (existsSync(mod, { cwd }) || existsSync(`${mod}.js`, { cwd })) {
mod = resolve(mod)
}
require(mod)
}
require(mod)
}
}

Expand Down

0 comments on commit 76b4290

Please sign in to comment.