Skip to content

Commit

Permalink
Pipes to standard I/O are invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Mar 13, 2024
1 parent 547fa35 commit bfb19f4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"streamx": "^2.13.2"
},
"devDependencies": {
"bare-os": "^2.0.0",
"bare-path": "^2.0.0",
"brittle": "^3.2.1",
"standard": "^17.0.0"
Expand Down
21 changes: 1 addition & 20 deletions test.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
/* global Bare */
const test = require('brittle')
const os = require('bare-os')
const Pipe = require('.')

const isWindows = Bare.platform === 'win32'

test('stdout', { skip: isWindows }, (t) => {
t.plan(1)

const stdout = new Pipe(1)
stdout
.on('close', () => t.pass('closed'))
.end('hello from pipe\n')
})

test('stderr', { skip: isWindows }, (t) => {
t.plan(1)

const stdout = new Pipe(2)
stdout
.on('close', () => t.pass('closed'))
.end('hello from pipe\n')
})

test('named pipe', (t) => {
t.plan(1)

Expand Down Expand Up @@ -68,7 +49,7 @@ test('server', async (t) => {

function name () {
const name = 'bare-pipe-' + Math.random().toString(16).slice(2) + Math.random().toString(16).slice(2)
return os.platform() === 'win32'
return isWindows
? '\\\\.\\pipe\\' + name
: '/tmp/' + name + '.sock'
}

0 comments on commit bfb19f4

Please sign in to comment.