## 事象 [[Bun]]で以下のような[[Parameterized Test]]を書いた。 ```ts import { expect, test } from "bun:test"; import { minimatch } from "minimatch"; test.each([ ["hoge.md", "*.txt", false], ])( `minimatch("%s", "%s") return %s`, (text: string, pattern: string, expected: boolean) => { expect(minimatch(text, pattern)).toBe(expected); } ); ``` これは以下のようになる。 ```console ✓ minimatch("hoge.md", "*.txt") return %s ``` 以下のように`boolean`の中身を表示したい。 ```console ✓ minimatch("hoge.md", "*.txt") return false ``` ## 解決方法 `%o`を使う。 ```diff - `minimatch("%s", "%s") return %s`, + `minimatch("%s", "%s") return %o`, ``` ## 参考 - [全体 · Jest](https://jestjs.io/ja/docs/api)