From f85602715bd4a3414c07795810c82d79426bf08f Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 21 Aug 2023 12:00:49 +0200 Subject: [PATCH] wtf --- test/index.js | 96 +++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/test/index.js b/test/index.js index b80dbca..d3c9ac8 100644 --- a/test/index.js +++ b/test/index.js @@ -15,14 +15,15 @@ */ import assert from 'node:assert/strict' -import {exec as execCb, spawn} from 'node:child_process' +import {exec as execCb} from 'node:child_process' +// . spawn import fs from 'node:fs/promises' // . import {sep} from 'node:path' -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' -import concatStream from 'concat-stream' +// . import concatStream from 'concat-stream' import stripAnsi from 'strip-ansi' const exec = promisify(execCb) @@ -680,60 +681,59 @@ test('args', async function (t) { // ) // }) - await t.test('should support `--watch`', async function () { - // Ignore checking watch mode on Windows. - if (platform === 'win32') { - console.warn('Not checking watch mode on windows…') - return - } + // await t.test('should support `--watch`', async function () { + // // Ignore checking watch mode on Windows. + // if (platform === 'win32') { + // console.warn('Not checking watch mode on windows…') + // return + // } - const url = new URL('watch.txt', base) - await fs.writeFile(url, 'alpha') + // const url = new URL('watch.txt', base) + // await fs.writeFile(url, 'alpha') - await new Promise(function (resolve) { - const delay = 500 + // await new Promise(function (resolve) { + // const delay = 500 - const proc = spawn(binPath, ['watch.txt', '-w']) + // const proc = spawn(binPath, ['watch.txt', '-w']) - setTimeout(seeYouLaterAlligator, delay) + // setTimeout(seeYouLaterAlligator, delay) - proc.on('close', async function (code) { - assert.equal(code, 0) - await fs.unlink(url) - resolve(undefined) - }) + // proc.on('close', async function (code) { + // assert.equal(code, 0) + // await fs.unlink(url) + // resolve(undefined) + // }) - proc.stdout.pipe( - concatStream(function (d) { - assert.deepEqual(String(d), '') - }) - ) - proc.stderr.pipe( - concatStream(function (d) { - assert.deepEqual( - cleanError(String(d)), - [ - 'Watching... (press CTRL+C to exit)', - 'watch.txt: no issues found', - 'watch.txt: no issues found', - '\n' - ].join('\n') - ) - }) - ) + // proc.stdout.pipe( + // concatStream(function (d) { + // assert.deepEqual(String(d), '') + // }) + // ) + // proc.stderr.pipe( + // concatStream(function (d) { + // assert.deepEqual( + // cleanError(String(d)), + // [ + // 'Watching... (press CTRL+C to exit)', + // 'watch.txt: no issues found', + // 'watch.txt: no issues found', + // '\n' + // ].join('\n') + // ) + // }) + // ) - async function seeYouLaterAlligator() { - await fs.writeFile(url, 'bravo') - setTimeout(afterAWhileCrocodile, delay) - } + // async function seeYouLaterAlligator() { + // await fs.writeFile(url, 'bravo') + // setTimeout(afterAWhileCrocodile, delay) + // } - function afterAWhileCrocodile() { - proc.kill('SIGINT') - } - }) - }) + // function afterAWhileCrocodile() { + // proc.kill('SIGINT') + // } + // }) + // }) - // . // await t.test('should not regenerate when watching', async function () { // // Ignore checking watch mode on Windows. // if (platform === 'win32') {