| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | |
| 3 | import { RepositoryNotFoundError } |
| 4 | import { orNull } |
| 5 | |
| 6 | describe('orNull', () |
| 7 | it('answers null for a refusal or a miss, which GitHub reads as "could not resolve"', |
| 8 | await expect( |
| 9 | orNull(Promise.reject |
| 10 | ).resolves.toBeNull() |
| 11 | }); |
| 12 | |
| 13 | it('lets any other failure through, so a database error is not reported as not found', |
| 14 | const failure = |
| 15 | await expect(orNull |
| 16 | }); |
| 17 | }); |