(n, kind)
| 281 | // Read content of the n-th file of `kind`. Binary kinds (screenshot) are |
| 282 | // returned as Buffer; text kinds as utf8 string. |
| 283 | nth(n, kind) { |
| 284 | const p = this.pathAt(n, kind) |
| 285 | if (!p) return null |
| 286 | try { |
| 287 | if (kind === 'screenshot') return fs.readFileSync(p) |
| 288 | return fs.readFileSync(p, 'utf8') |
| 289 | } catch { return null } |
| 290 | } |
| 291 | |
| 292 | first(kind) { return this.nth(0, kind) } |
| 293 | last(kind) { return this.nth(-1, kind) } |
no test coverage detected