From 4d8769971b06c4f30fc35e642ced7f131f009b39 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Thu, 19 Mar 2020 17:46:36 +0900 Subject: [PATCH] Refactor (#54) * run `npm ci` instead of `npm install` for PR build * bump version * return Promise for test mock --- .github/workflows/test.yml | 2 +- __tests__/main.test.ts | 8 ++++---- package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c14ae50..de91fc5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v2 - run: | - npm install + npm ci npm run all - uses: coverallsapp/github-action@master with: diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index f48eb97..1a2b03f 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -27,8 +27,8 @@ describe('run', () => { path.join(__dirname, 'testdata/audit/success.txt') ), status: 0, - run: (): void => { - return + run: (): Promise => { + return Promise.resolve(void 0) }, foundVulnerability: (): boolean => { return false @@ -60,8 +60,8 @@ describe('run', () => { path.join(__dirname, 'testdata/audit/error.txt') ), status: 1, - run: (): void => { - return + run: (): Promise => { + return Promise.resolve(void 0) }, foundVulnerability: (): boolean => { return true diff --git a/package.json b/package.json index 05200a5..3062fda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "npm-audit-action", - "version": "1.1.0", + "version": "1.2.0", "private": true, "description": "GitHub Action to run `npm audit`", "main": "lib/main.js",