Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Test
on:
pull_request:
push:
branches:
- main
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"scripts": {
"test": "mocha && tsd",
"test:types": "tsd",
"lint": "standard",
"debug": "mocha --inspect --inspect-brk --timeout=0",
"prepublishOnly": "npm t",
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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))

Expand Down