thread-stream 3.0.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/ts.test.ts DELETED
@@ -1,33 +0,0 @@
1
- import { test } from 'tap'
2
- import { readFile } from 'fs'
3
- import ThreadStream from '../index.js'
4
- import { join } from 'path'
5
- import { file } from './helper.js'
6
-
7
-
8
- test('typescript module', function (t) {
9
- t.plan(5)
10
-
11
- const dest = file()
12
- const stream = new ThreadStream({
13
- filename: join(__dirname, 'ts', 'to-file.ts'),
14
- workerData: { dest },
15
- sync: true
16
- })
17
-
18
- stream.on('finish', () => {
19
- readFile(dest, 'utf8', (err, data) => {
20
- t.error(err)
21
- t.equal(data, 'hello world\nsomething else\n')
22
- })
23
- })
24
-
25
- stream.on('close', () => {
26
- t.pass('close emitted')
27
- })
28
-
29
- t.ok(stream.write('hello world\n'))
30
- t.ok(stream.write('something else\n'))
31
-
32
- stream.end()
33
- })