File tree Expand file tree Collapse file tree 3 files changed +0
-17
lines changed
packages/npm-packages/ruby-wasm-wasi Expand file tree Collapse file tree 3 files changed +0
-17
lines changed Original file line number Diff line number Diff line change 22require "js"
33
44class JS ::TestError < Test ::Unit ::TestCase
5- using JsObjectTestable
6-
75 def test_throw_error
86 e = assert_raise ( JS ::Error ) { JS . eval ( "throw new Error('foo')" ) }
97 assert_match /^Error: foo/ , e . message
Original file line number Diff line number Diff line change 22require "js"
33
44class JS ::TestFloat < Test ::Unit ::TestCase
5- using JsObjectTestable
6-
75 def test_to_js
86 assert_equal ( 1.0 ) . to_js , JS . eval ( "return 1.0;" )
97 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) => {
166166 const rootTestFile = " /__root__/test/test_unit.rb" ;
167167 const { vm } = await instantiate(rootTestFile);
168168
169-
170169 await vm.evalAsync(`
171170 require ' test/unit'
172171
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-
185172 require_relative ' ${rootTestFile}'
186173 ok = Test::Unit::AutoRunner.run
187174 exit(1) unless ok
You can’t perform that action at this time.
0 commit comments