mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2025-12-27 13:08:17 +00:00
Set Jest config file in package script Include module path Include tests in project folders Remove index module exports Hardcode configuration parameters Move parameter binding into main run function Use alias imports Run test sequentially Remove cleanup (async conflict) Revert Jest option Increase test timeout to 15 seconds
28 lines
No EOL
802 B
TypeScript
28 lines
No EOL
802 B
TypeScript
// Using require instead of import to support integration testing
|
|
import * as exec from '@actions/exec';
|
|
import * as core from '@actions/core';
|
|
|
|
export const cmd = async (command: string, ...args: any): Promise<string> => {
|
|
let output = '', errors = '';
|
|
const options = {
|
|
silent: true,
|
|
listeners: {
|
|
stdout: (data: any) => { output += data.toString(); },
|
|
stderr: (data: any) => { errors += data.toString(); },
|
|
ignoreReturnCode: true,
|
|
silent: true
|
|
}
|
|
};
|
|
|
|
try {
|
|
await exec.exec(command, args, options);
|
|
} catch (err) {
|
|
//core.info(`The command cd '${command} ${args.join(' ')}' failed: ${err}`);
|
|
}
|
|
|
|
if (errors !== '') {
|
|
//core.info(`stderr: ${errors}`);
|
|
}
|
|
|
|
return output;
|
|
}; |