MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / runSample

Function runSample

storagetransfer/test/utils/sample.js:29–34  ·  view source on GitHub ↗

* Runs a sample and returns its output * * @param {string} sample name of sample to run. No need for '.js' suffix. * @param {string[]} args the arguments to pass to the sample * @returns {string} output of the command

(sample, args = [])

Source from the content-addressed store, hash-verified

27 * @returns {string} output of the command
28 */
29async function runSample(sample, args = []) {
30 return execFileSync('node', [`${sample}.js`, ...args], {
31 encoding: 'utf-8',
32 cwd: path.join(__dirname, '..', '..'),
33 });
34}
35
36module.exports = {
37 runSample,

Calls

no outgoing calls

Tested by

no test coverage detected