There was an error while loading. Please reload this page.
1 parent 05d2f6a commit 23e33f0Copy full SHA for 23e33f0
1 file changed
test/async_test.rb
@@ -211,16 +211,16 @@ def test_nested_sync_eval_does_not_consume_timeout
211
end
212
)
213
214
+ source = <<~JS
215
+ runSlowEval();
216
+ (() => {
217
+ const start = Date.now();
218
+ while (Date.now() - start < 500) {}
219
+ })();
220
+ JS
221
+
222
assert_raises(MiniRacer::ScriptTerminatedError) do
- Timeout.timeout(2) do
- context.eval(<<~JS)
- runSlowEval();
- (() => {
- const start = Date.now();
- while (Date.now() - start < 500) {}
- })();
- JS
223
- end
+ Timeout.timeout(2) { context.eval(source) }
224
225
assert nested_terminated
226
assert_equal 2, context.eval("1 + 1")
0 commit comments