Skip to content

Commit 0862a80

Browse files
committed
test cleanup
1 parent d6247bc commit 0862a80

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

test/atomic/Console.test.res

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,21 @@ zoraBlock("Console", t => {
2424
"stdout": Process.stdout(process),
2525
})
2626

27+
Js.log("=== Testing console output styles ===")
2728
c1->Console.logMany(["a", "b"])
2829
c2->Console.table(["hi", "bye"])
29-
c2->Console.table([Js.Dict.fromArray([("a", 1), ("b", 2)])])
30+
c2->Console.table([
31+
{
32+
"a": 1,
33+
"b": 2,
34+
},
35+
])
36+
Console.console->Console.dir({
37+
"hello": "world",
38+
"this": "is",
39+
"an": "object",
40+
})
41+
Js.log("=== END testing console output styles ===")
3042

3143
t->block("New console instance should be defined", t =>
3244
t->notEqual(Js.Undefined.return(c1), Js.Undefined.empty, "")

test/atomic/Stream.test.res

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
open Zora
22
open StreamTestLib
33

4-
// avoid using rescript-zora `then` or `done`, to retain commonjs compatibility
54
let {then, resolve: done} = module(Promise)
65

76
zoraBlock("Stream.Readable", t => {
@@ -23,24 +22,18 @@ zoraBlock("Stream.Readable", t => {
2322

2423
t->test("'Stream.Readable.destroyWithError' should emit 'error' event", t => {
2524
open! Errors
26-
let dummyError = Error.make("Destroyed")->Error.toJsExn
27-
Promise.make((resolve, _reject) =>
28-
StreamTestLib.makeReadableEmpty()
29-
->Stream.onError(err => {
30-
{
31-
open Console
32-
console->dir(err)
33-
}
34-
25+
let dummyError = Error.make("Expected error: Stream destroyed")->Error.toJsExn
26+
Promise.make((resolve, _reject) => {
27+
let stream = StreamTestLib.makeReadableEmpty()->Stream.onError(err => {
3528
t->equal(err, dummyError, "")
3629

3730
// oh these bindings are wonderful aren't they
3831
let a = ()
3932
resolve(. a)
4033
})
41-
->Stream.destroyWithError(dummyError)
42-
->ignore
43-
)
34+
35+
Js.Global.setTimeout(() => stream->Stream.destroyWithError(dummyError)->ignore, 10)->ignore
36+
})
4437
})
4538

4639
t->block("'Stream.Readable.destroy' should return the exact same instance of 'Readable'", t => {

0 commit comments

Comments
 (0)