eng: fix --run path in electron tests not working (#225422)

I assume this broke with some of the ESM work, but I have no idea how it was working before. This should be a better fix.
This commit is contained in:
Connor Peet
2024-08-12 09:58:54 -07:00
committed by GitHub
parent 65d1afaf4e
commit 7dde0a7943

View File

@@ -158,9 +158,8 @@ function loadTestModules(opts) {
if (opts.run) {
const files = Array.isArray(opts.run) ? opts.run : [opts.run];
const modules = files.map(file => {
file = file.replace(/^src/, 'out');
file = file.replace(/\.ts$/, '.js');
return path.relative(_out, file).replace(/\.js$/, '');
file = file.replace(/^src[\\/]/, '');
return file.replace(/\.[jt]s$/, '');
});
return loadModules(modules);
}