Skip to content

Commit

Permalink
Merge pull request #2 from Kikobeats/windows
Browse files Browse the repository at this point in the history
test: better error assertion
  • Loading branch information
Kikobeats authored Dec 12, 2023
2 parents f6ecb38 + ab077a9 commit 9a04a05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Test
run: pnpm test
- name: Report
run: mkdir -p coverage && npx c8 report --reporter=text-lcov > coverage/lcov.info
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
uses: coverallsapp/github-action@main
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Test
run: pnpm test
- name: Report
run: mkdir -p coverage && npx c8 report --reporter=text-lcov > coverage/lcov.info
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
uses: coverallsapp/github-action@main
with:
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Test
run: pnpm test
- name: Report
run: mkdir -p coverage && npx c8 report --reporter=text-lcov > coverage/lcov.info
run: npx c8 report --reporter=text-lcov > coverage/lcov.info
- name: Coverage
uses: coverallsapp/github-action@main
with:
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const test = require('ava')
const $ = require('..').extend({ shell: true })

test('meaningful errors', async t => {
const error = await $('node -e \'require("notfound")\'').catch(error => error)
const error = await $('node --foo').catch(error => error)
t.is(error.name, 'ChildProcessError')
t.is(error.stderr.includes("Cannot find module 'notfound'"), true)
t.is(error.stderr, 'node: bad option: --foo')
t.is(error.stdout, '')
t.is(error.exitCode, 1)
t.is(error.exitCode, 9)
t.is(error.signalCode, null)
t.is(error.killed, false)
})
Expand All @@ -31,7 +31,7 @@ test.serial('last break line is removed', async t => {
})

test('run a file', async t => {
const { stdout } = await $('node -e \'console.log("hello world")\'')
const { stdout } = await $('node -p "\'hello world\'"')
t.is(stdout, 'hello world')
})

Expand Down

0 comments on commit 9a04a05

Please sign in to comment.