thread-stream
Advanced tools
Comparing version 0.13.0 to 0.13.1
@@ -33,3 +33,3 @@ 'use strict' | ||
workerData.filename.startsWith('file://')) { | ||
fn = realRequire(workerData.filename.replace('file://', '')) | ||
fn = realRequire(decodeURIComponent(workerData.filename.replace('file://', ''))) | ||
} else { | ||
@@ -36,0 +36,0 @@ throw error |
{ | ||
"name": "thread-stream", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"description": "A streaming way to send data to a Node.js Worker Thread", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
'use strict' | ||
const { test } = require('tap') | ||
const { join } = require('path') | ||
const { MessageChannel } = require('worker_threads') | ||
const { once } = require('events') | ||
const ThreadStream = require('..') | ||
@@ -30,1 +33,25 @@ | ||
}) | ||
test('yarn module resolution for directories with special characters', { skip: !isYarnPnp }, async t => { | ||
t.plan(3) | ||
const { port1, port2 } = new MessageChannel() | ||
const stream = new ThreadStream({ | ||
filename: join(__dirname, 'dir with spaces', 'test-package.zip', 'worker.js'), | ||
workerData: { port: port1 }, | ||
workerOpts: { | ||
transferList: [port1] | ||
}, | ||
sync: false | ||
}) | ||
t.teardown(() => { | ||
stream.end() | ||
}) | ||
t.ok(stream.write('hello world\n')) | ||
t.ok(stream.write('something else\n')) | ||
const [strings] = await once(port2, 'message') | ||
t.equal(strings, 'hello world\nsomething else\n') | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48383
37
1467