【发布时间】:2021-12-08 07:11:28
【问题描述】:
我正在寻找通过命令行将参数传递给我的 ava 测试文件的方法,我找到了这个文档。 https://github.com/avajs/ava/blob/main/docs/recipes/passing-arguments-to-your-test-files.md
// test.js const test = require('ava');
test('argv', t => {
t.deepEqual(process.argv.slice(2), ['--hello', 'world']);
});
$ npx ava -- --hello world
我想知道这段代码实际上在做什么,但我在网上找不到其他相关话题谈论这个。有谁能给我解释一下吗?
【问题讨论】:
标签: node.js typescript playwright ava yargs