Skip to content

Commit 28ed8ea

Browse files
committed
Test breaking on ReScript 10
1 parent 4bb05d1 commit 28ed8ea

File tree

2 files changed

+42
-48
lines changed

2 files changed

+42
-48
lines changed

lib/js/test/atomic/Stream.test.bs.js

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/atomic/Stream.test.res

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
open Zora
22
open StreamTestLib
3-
4-
let {then, resolve: done} = module(Promise)
5-
3+
ti
64
zoraBlock("Stream.Readable", t => {
75
t->block("'Stream.Readable.make' should return a defined value", t => {
86
let readable = makeReadableEmpty()
@@ -23,17 +21,21 @@ zoraBlock("Stream.Readable", t => {
2321
t->test("'Stream.Readable.destroyWithError' should emit 'error' event", t => {
2422
open! Errors
2523
let dummyError = Error.make("Expected error: Stream destroyed")->Error.toJsExn
26-
Promise.make((resolve, _reject) => {
27-
let stream = StreamTestLib.makeReadableEmpty()->Stream.onError(err => {
28-
t->equal(err, dummyError, "")
24+
Promise.make(
25+
(resolve, _reject) => {
26+
let stream = StreamTestLib.makeReadableEmpty()->Stream.onError(
27+
err => {
28+
t->equal(err, dummyError, "")
2929

30-
// oh these bindings are wonderful aren't they
31-
let a = ()
32-
resolve(. a)
33-
})
30+
// oh these bindings are wonderful aren't they
31+
let a = ()
32+
resolve(. a)
33+
},
34+
)
3435

35-
Js.Global.setTimeout(() => stream->Stream.destroyWithError(dummyError)->ignore, 10)->ignore
36-
})
36+
Js.Global.setTimeout(() => stream->Stream.destroyWithError(dummyError)->ignore, 10)->ignore
37+
},
38+
)
3739
})
3840

3941
t->block("'Stream.Readable.destroy' should return the exact same instance of 'Readable'", t => {
@@ -69,32 +71,34 @@ zoraBlock("Stream.Writable", t => {
6971
(),
7072
)
7173

72-
Promise.make((resolve, _reject) => {
73-
let writeStream = Writable.makeObjMode(options)
74-
75-
Writable.writeWith(
76-
writeStream,
77-
42,
78-
~callback=_ => {
79-
let actual = switch args.contents {
80-
| None => None
81-
| Some((wstream, value, encoding, cb)) =>
82-
Some((
83-
Internal__JsTypeReflection.constructorName(wstream) === "Writable",
84-
Js.typeof(value) === "number",
85-
Js.typeof(encoding) === "string",
86-
Js.typeof(cb) === "function",
87-
))
88-
}
89-
t->equal(actual, Some((true, true, true, true)), "")
90-
91-
// oh these bindings are wonderful aren't they
92-
let a = ()
93-
resolve(. a)
94-
},
95-
(),
96-
)->ignore
97-
})
74+
Promise.make(
75+
(resolve, _reject) => {
76+
let writeStream = Writable.makeObjMode(options)
77+
78+
Writable.writeWith(
79+
writeStream,
80+
42,
81+
~callback=_ => {
82+
let actual = switch args.contents {
83+
| None => None
84+
| Some((wstream, value, encoding, cb)) =>
85+
Some((
86+
Internal__JsTypeReflection.constructorName(wstream) === "Writable",
87+
Js.typeof(value) === "number",
88+
Js.typeof(encoding) === "string",
89+
Js.typeof(cb) === "function",
90+
))
91+
}
92+
t->equal(actual, Some((true, true, true, true)), "")
93+
94+
// oh these bindings are wonderful aren't they
95+
let a = ()
96+
resolve(. a)
97+
},
98+
(),
99+
)->ignore
100+
},
101+
)
98102
},
99103
)
100104
})

0 commit comments

Comments
 (0)