Skip to content

Commit

Permalink
only record an error if it is present
Browse files Browse the repository at this point in the history
  • Loading branch information
cowboyd committed Jan 30, 2024
1 parent 6a3d294 commit 7130ede
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion javascript-effection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ deno task test
You will need [Node](https://nodejs.org) >= 18 installed. If you are using,
[Volta](https://volta.sh) this will be configured for you automatically.

``` shellsession
```shellsession
$ npm install
$ npx tsx --test easyracer.test.ts
```
7 changes: 5 additions & 2 deletions javascript-effection/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ export function rightOrNot(ops: Operation<unknown>[]): Operation<string> {
});
tasks.push(task);
}
let last: unknown = null;
let last = "";
for (let task of tasks) {
last = yield* task;
let result = yield* task;
if (result) {
last = String(result);
}
}
// not!
resolve(String(last));
Expand Down

0 comments on commit 7130ede

Please sign in to comment.