mirror of
https://github.com/actions/cache.git
synced 2024-12-27 14:28:01 +08:00
Prevent commands from executing during tests
This commit is contained in:
parent
d676b6c354
commit
50eb90a503
@ -8,4 +8,15 @@ module.exports = {
|
|||||||
'^.+\\.ts$': 'ts-jest'
|
'^.+\\.ts$': 'ts-jest'
|
||||||
},
|
},
|
||||||
verbose: true
|
verbose: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const processStdoutWrite = process.stdout.write.bind(process.stdout)
|
||||||
|
process.stdout.write = (str, encoding, cb) => {
|
||||||
|
// We don't want :: commands to be executed by the runner during tests
|
||||||
|
// Replace any :: with :
|
||||||
|
if (!str.match(/^::/)) {
|
||||||
|
return processStdoutWrite(str, encoding, cb);
|
||||||
|
} else {
|
||||||
|
return processStdoutWrite(str.replace(/::/g, ":"), encoding, cb);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user