test: add coverage (#58)
This commit is contained in:
+2
-1
@@ -1,2 +1,3 @@
|
||||
node_modules/
|
||||
.env
|
||||
coverage
|
||||
node_modules/
|
||||
|
||||
+2
-1
@@ -100,6 +100,7 @@ export async function main(
|
||||
authorization: `bearer ${appAuthentication.token}`,
|
||||
},
|
||||
}).catch((error) => {
|
||||
/* c8 ignore next */
|
||||
if (error.status !== 404) throw error;
|
||||
|
||||
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
|
||||
@@ -122,7 +123,7 @@ export async function main(
|
||||
core.setSecret(authentication.token);
|
||||
|
||||
core.setOutput("token", authentication.token);
|
||||
|
||||
|
||||
// Make token accessible to post function (so we can invalidate it)
|
||||
if (!skipTokenRevoke) {
|
||||
core.saveState("token", authentication.token);
|
||||
|
||||
@@ -33,6 +33,7 @@ main(
|
||||
}),
|
||||
skipTokenRevoke
|
||||
).catch((error) => {
|
||||
/* c8 ignore next 3 */
|
||||
console.error(error);
|
||||
core.setFailed(error.message);
|
||||
});
|
||||
|
||||
Generated
+1673
-2
File diff suppressed because it is too large
Load Diff
+5
-1
@@ -6,7 +6,9 @@
|
||||
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
||||
"scripts": {
|
||||
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node16.16",
|
||||
"test": "ava tests/index.js"
|
||||
"test": "c8 --100 ava tests/index.js",
|
||||
"coverage": "c8 report --reporter html",
|
||||
"postcoverage": "open-cli coverage/index.html"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -16,9 +18,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^5.3.1",
|
||||
"c8": "^8.0.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"esbuild": "^0.19.4",
|
||||
"execa": "^8.0.1",
|
||||
"open-cli": "^7.2.0",
|
||||
"undici": "^5.25.2"
|
||||
},
|
||||
"release": {
|
||||
|
||||
Reference in New Issue
Block a user