diff --git a/lib/space_shoes/guest/app.rb b/lib/space_shoes/guest/app.rb index 1b12130..79f395b 100644 --- a/lib/space_shoes/guest/app.rb +++ b/lib/space_shoes/guest/app.rb @@ -38,11 +38,28 @@ def e.shutdown; end def e.start; end Minitest.parallel_executor = e # No threads available in ruby.wasm result = Minitest.run [] - # TODO: add a DOM element or similar so we know when this is complete - JS.global[:document][:shoes_spec_passed] = result + test_details = ShoesSpec.test_class.results # Should only be one test class + + JS.global[:document][:shoes_spec] = {} + + JS.global[:document][:shoes_spec][:passed] = result + JS.global[:document][:shoes_spec][:cases] = test_details[:cases] + JS.global[:document][:shoes_spec][:assertions] = test_details[:assertions] + JS.global[:document][:shoes_spec][:failures] = test_details[:failures] + JS.global[:document][:shoes_spec][:errors] = test_details[:errors] + JS.global[:document][:shoes_spec][:skips] = test_details[:skips] + JS.global[:document][:shoes_spec][:err_objects] = test_details[:results].inspect + elt = JS.global[:document].createElement("div") elt[:className] = "minitest_result" - test_details = ShoesSpec.test_class.results # Should only be one test class + + elt[:dataset][:cases] = test_details[:cases] + elt[:dataset][:assertions] = test_details[:assertions] + elt[:dataset][:failures] = test_details[:failures] + elt[:dataset][:errors] = test_details[:errors] + elt[:dataset][:skips] = test_details[:skips] + elt[:dataset][:err_objects] = test_details[:results].inspect + elt[:innerHTML] = "
#{result ? "passed" : "failed"}
#{test_details}
" JS.global[:document][:body].appendChild(elt)