diff --git a/tests/main-missing-repository.test.js b/tests/main-missing-repository.test.js new file mode 100644 index 0000000..7bec9a8 --- /dev/null +++ b/tests/main-missing-repository.test.js @@ -0,0 +1,12 @@ +// Verify `main` exits with an error when `GITHUB_REPOSITORY` is missing. +// @ts-check + +delete process.env.GITHUB_REPOSITORY; + +(async () => { + try { + await import("../main.js"); + } catch (error) { + console.error(error.message); + } +})(); diff --git a/tests/snapshots/index.js.md b/tests/snapshots/index.js.md index 652824d..a8cfc23 100644 --- a/tests/snapshots/index.js.md +++ b/tests/snapshots/index.js.md @@ -4,6 +4,16 @@ The actual snapshot is saved in `index.js.snap`. Generated by [AVA](https://avajs.dev). +## main-missing-repository.test.js + +> stderr + + 'GITHUB_REPOSITORY missing, must be set to \'/\'' + +> stdout + + '' + ## post-token-set.test.js > stderr diff --git a/tests/snapshots/index.js.snap b/tests/snapshots/index.js.snap index e33d42d..3e3f2e6 100644 Binary files a/tests/snapshots/index.js.snap and b/tests/snapshots/index.js.snap differ