Deepen all 16 pear-platform scaffolds to production APIs.
Expands spawn, argv, preflight, trust, OTA, pipes, and headless UI modules; bumps to 0.3.1 with fuller tests and registry tier updates. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -4,8 +4,17 @@ const { HyperPearWorkerPipe } = require('../index.js')
|
||||
|
||||
test('pipe messages', async (t) => {
|
||||
const p = new HyperPearWorkerPipe()
|
||||
const pipe = p.create('p1')
|
||||
p.send('p1', { hello: 1 })
|
||||
t.is(p.drain('p1').length, 1)
|
||||
const pipe = p.create('main')
|
||||
p.send('main', { hello: 1 })
|
||||
t.is(p.drain('main')[0].msg.hello, 1)
|
||||
await p.close()
|
||||
})
|
||||
|
||||
test('linked pair', async (t) => {
|
||||
const p = new HyperPearWorkerPipe()
|
||||
const { a, b } = p.createLinkedPair()
|
||||
p.send(a.id, 'ping')
|
||||
const got = p.drain(b.id)
|
||||
t.is(got[0].msg, 'ping')
|
||||
await p.close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user