-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eventual-send): breakpoint on delivery by env-options
- Loading branch information
Showing
4 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* global process */ | ||
|
||
process.env.BREAKPOINTS = [ | ||
// One line per breakpoint directive. | ||
'Alleged: Bob.foo=*', | ||
'*.bar=0', | ||
].join(','); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import './prepare-breakpoints.js'; | ||
import { test } from './prepare-test-env-ava.js'; | ||
|
||
// eslint-disable-next-line import/order | ||
import { E } from '@endo/eventual-send'; | ||
import { Far } from '../src/make-far.js'; | ||
|
||
// Example from test-deep-send.js in @endo/eventual-send | ||
|
||
const carol = Far('Carol', { | ||
bar: () => console.log('Wut?'), | ||
}); | ||
|
||
const bob = Far('Bob', { | ||
foo: carolP => E(carolP).bar(), | ||
}); | ||
|
||
const alice = Far('Alice', { | ||
test: () => E(bob).foo(carol), | ||
}); | ||
|
||
// This is not useful as an automated test. Its purpose is to run it under a | ||
// debugger and see where it breakpoints. To play with it, adjust the | ||
// settings in prepare-breakpoints.js and try again. | ||
test('test breakpoints on delivery', async t => { | ||
await alice.test(); | ||
t.pass('introduced'); | ||
}); |