Skip to content

Commit

Permalink
asdasdasd
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 21, 2023
1 parent eadfe05 commit 41367cd
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import {sep} from 'node:path'
import {EOL} from 'node:os'
// . import {platform} from 'node:process'
import {platform} from 'node:process'
import test from 'node:test'
import {fileURLToPath} from 'node:url'
// . import {promisify} from 'node:util'
Expand Down Expand Up @@ -680,8 +680,8 @@ test('args', async function (t) {
})

await t.test('should support `--watch`', async function () {
// On Windows, `SIGINT` results in an error, as it has to be forced.
// Hence `reject: false` and `exitCode`.
// On Windows, `SIGINT` crashes immediately and results in an error.
// Hence `reject: false`, `exitCode`, and extra lines when non-windows.
const delay = 500
const url = new URL('watch.txt', base)

Expand All @@ -695,17 +695,17 @@ test('args', async function (t) {

await fs.unlink(url)

assert.equal(result.stdout, '')
assert.equal(
cleanError(result.stderr),
const lines = [
'Watching... (press CTRL+C to exit)',
'watch.txt: no issues found'
]

[
'Watching... (press CTRL+C to exit)',
'watch.txt: no issues found',
'watch.txt: no issues found',
''
].join('\n')
)
if (platform !== 'win32') {
lines.push('watch.txt: no issues found', '')
}

assert.equal(result.stdout, '')
assert.equal(cleanError(result.stderr), lines.join('\n'))
assert.equal(result.exitCode, 0)

async function seeYouLaterAlligator() {
Expand All @@ -732,18 +732,18 @@ test('args', async function (t) {

await fs.unlink(url)

const lines = [
'Watching... (press CTRL+C to exit)',
'Note: Ignoring `--output` until exit.',
'watch.txt: no issues found'
]

if (platform !== 'win32') {
lines.push('watch.txt: no issues found', '', 'watch.txt: written')
}

assert.equal(result.stdout, '')
assert.equal(
cleanError(result.stderr),
[
'Watching... (press CTRL+C to exit)',
'Note: Ignoring `--output` until exit.',
'watch.txt: no issues found',
'watch.txt: no issues found',
'',
'watch.txt: written'
].join('\n')
)
assert.equal(cleanError(result.stderr), lines.join('\n'))
assert.equal(result.exitCode, 0)

async function seeYouLaterAlligator() {
Expand Down

0 comments on commit 41367cd

Please sign in to comment.