Skip to content

Commit

Permalink
feat(E): . adding tests for the sendOnly variant.
Browse files Browse the repository at this point in the history
1st test added.
  • Loading branch information
zarutian authored Oct 12, 2020
1 parent 2b1eb5b commit 19182b3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/eventual-send/test/test-e.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,26 @@ test('E method calls', async t => {
t.is(await d, 12, 'method call works');
});

test('E sendOnly method calls', async t => {
let testIncrDoneResolver;
const testIncrDone = new Promise((resolve) => {
testIncrDoneResolver = resolve;
});

let count = 0;
const counter = {
incr(n) {
count = count + n;
testIncrDone(); // only here for the test.
return count;
},
};
const result = E.sendOnly(counter).incr(42);
t.is(typeof result, 'undefined', 'return is undefined as expected');
await testIncrDone;
t.is(count, 42, 'sendOnly method call variant works');
});

test('E call missing method', async t => {
const x = {
double(n) {
Expand Down

0 comments on commit 19182b3

Please sign in to comment.