fake-exec:假child_process#exec输出以进行测试

时间:2021-05-18 15:31:07
【文件属性】:
文件名称:fake-exec:假child_process#exec输出以进行测试
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-18 15:31:07
JavaScript 假执行 假child_process#exec输出以进行测试。 安装 $ npm install fake-exec --save 用法 // include dependencies const fake = require ( 'fake-exec' ) ; const exec = require ( 'child_process' ) . exec ; // set up a fake command fake ( 'rm -rf /' , 'no, thank you' ) ; // execute a command using native child_process#exec method exec ( 'rm -rf /' , function ( err , stdout ) { stdout === 'no, thank you' ; // true } )
【文件预览】:
fake-exec-master
----.gitignore(22B)
----package.json(836B)
----Makefile(257B)
----index.js(2KB)
----test.js(2KB)
----Readme.md(836B)
----circle.yml(35B)

网友评论