diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43a9243..2c1f025 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,6 @@ name: Test on: + pull_request: push: branches: - main diff --git a/package.json b/package.json index 37bb03b..31af0b7 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ }, "scripts": { "test": "mocha && tsd", + "test:types": "tsd", "lint": "standard", "debug": "mocha --inspect --inspect-brk --timeout=0", "prepublishOnly": "npm t", @@ -41,10 +42,10 @@ }, "devDependencies": { "gen-esm-wrapper": "^1.1.0", - "mocha": "^9.1.3", - "standard": "^16.0.4", + "mocha": "^9.2.2", + "standard": "^17.1.2", "standard-version": "^9.3.2", - "tsd": "^0.19.0" + "tsd": "^0.27.0" }, "bin": { "nv": "./bin/nv" diff --git a/test/cli.js b/test/cli.js index bfca428..e61d7c8 100644 --- a/test/cli.js +++ b/test/cli.js @@ -9,16 +9,16 @@ const cwd = path.join(__dirname, '..') suite('nv cli', () => { test('should contain help information', () => { - const result = execFileSync(nv, ['--help'], { cwd: cwd }).toString() + const result = execFileSync(nv, ['--help'], { cwd }).toString() assert.ok(result.includes('List Node.js versions')) }) test('should contain information about version 8', () => { - const result = JSON.parse(execFileSync(nv, ['ls', '8'], { cwd: cwd }).toString()) + const result = JSON.parse(execFileSync(nv, ['ls', '8'], { cwd }).toString()) assert.strictEqual(result.codename, 'carbon') }) test('should contain output newline json', () => { - const result = execFileSync(nv, ['ls', '8.x', '--no-pretty-json'], { cwd: cwd }) + const result = execFileSync(nv, ['ls', '8.x', '--no-pretty-json'], { cwd }) .toString().trim().split('\n') .map((line) => JSON.parse(line)) @@ -28,7 +28,7 @@ suite('nv cli', () => { }) }) test('should only contain the latest of each major', () => { - const result = execFileSync(nv, ['ls', '16.x || 18.x', '--no-pretty-json', '--latest-of-major-only'], { cwd: cwd }) + const result = execFileSync(nv, ['ls', '16.x || 18.x', '--no-pretty-json', '--latest-of-major-only'], { cwd }) .toString().trim().split('\n') .map((line) => JSON.parse(line))