JS: Stop overriding entire module.exports object in test

Doing `module.exports = blah` prevents other exports from being seen as library inputs.
This commit is contained in:
Asger F
2025-02-12 10:18:24 +01:00
parent f72cd21a55
commit 576dbcb020

View File

@@ -1,6 +1,6 @@
var cp = require("child_process")
module.exports = function (name) {
module.exports.blah = function (name) {
cp.exec("rm -rf " + name); // $ Alert
cp.execFile(name, [name]);
@@ -19,7 +19,7 @@ function cla() { }
cla.prototype.method = function (name) {
cp.exec("rm -rf " + name); // $ Alert
}
module.exports = new cla();
module.exports.cla = new cla();
function cla2() { }
@@ -474,7 +474,7 @@ const {promisify} = require('util');
const exec = promisify(require('child_process').exec);
module.exports = function check(config) {
module.exports.check = function check(config) {
const cmd = path.join(config.installedPath, 'myBinary -v'); // $ Alert
return exec(cmd);
}