File tree 3 files changed +0
-17
lines changed
packages/npm-packages/ruby-wasm-wasi
3 files changed +0
-17
lines changed Original file line number Diff line number Diff line change 2
2
require "js"
3
3
4
4
class JS ::TestError < Test ::Unit ::TestCase
5
- using JsObjectTestable
6
-
7
5
def test_throw_error
8
6
e = assert_raise ( JS ::Error ) { JS . eval ( "throw new Error('foo')" ) }
9
7
assert_match /^Error: foo/ , e . message
Original file line number Diff line number Diff line change 2
2
require "js"
3
3
4
4
class JS ::TestFloat < Test ::Unit ::TestCase
5
- using JsObjectTestable
6
-
7
5
def test_to_js
8
6
assert_equal ( 1.0 ) . to_js , JS . eval ( "return 1.0;" )
9
7
assert_equal ( 0.5 ) . to_js , JS . eval ( "return 0.5;" )
Original file line number Diff line number Diff line change @@ -166,22 +166,9 @@ const test = async (instantiate) => {
166
166
const rootTestFile = " /__root__/test/test_unit.rb" ;
167
167
const { vm } = await instantiate(rootTestFile);
168
168
169
-
170
169
await vm.evalAsync(`
171
170
require ' test/unit'
172
171
173
- # FIXME: This is a workaround for the test-unit gem.
174
- # It will be removed when the next pull request is merged and released.
175
- # https://github.com/test-unit/test-unit/pull/262
176
- require ' pp'
177
- module JsObjectTestable
178
- refine JS::Object do
179
- [:object_id, :pretty_inspect].each do | method|
180
- define_method(method, ::Object.instance_method(method))
181
- end
182
- end
183
- end
184
-
185
172
require_relative ' ${rootTestFile}'
186
173
ok = Test::Unit::AutoRunner.run
187
174
exit(1) unless ok
You can’t perform that action at this time.
0 commit comments