[[Bash]]などのshell commandの実行結果をassertionなどで使いたい場合。[[Developer Mode (Bruno)|Developer Mode]]を利用する。
`bruno.json`に`moduleWhitelist`と`filesystemAccess`を追加。
```json
{
"version": "1",
"name": "Sandbox",
"type": "collection",
"scripts": {
"moduleWhitelist": ["child_process"],
"filesystemAccess": {
"allow": true
}
}
}
```
bruファイルにtestsセクションを追加。
```js
tests {
const {execSync} = require("child_process")
test("name is correct", async () => {
// execSyncで読み込む
const r = execSync("ls -l", { encoding: "utf-8" })
expect(res.getBody().data.id).to.equal(r)
})
}
```