Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tpmccallum/6530b45eb30e7512ed2f66f70e5c45c3 to your computer and use it in GitHub Desktop.

Select an option

Save tpmccallum/6530b45eb30e7512ed2f66f70e5c45c3 to your computer and use it in GitHub Desktop.
tpmccallum$ cargo test --target wasm32-unknown-unknown 
    Finished test [unoptimized + debuginfo] target(s) in 0.10s
     Running target/wasm32-unknown-unknown/debug/deps/headless-f2eded3f78b0be11.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/wasm-bindgen-test-runner /Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/debug/deps/headless-f2eded3f78b0be11.wasm`
Running headless tests in Safari on `http://127.0.0.1:52627/`
Try find `webdriver.json` for configure browser's capabilities:
Ok
running 10 tests                                  

test headless::closures_work ... ok
test headless::can_log_html_strings ... ok
test headless::works ... ok
test headless::modules::test_get_five ... ok
test headless::snippets::duplicate_inline_not_unified ... ok
test headless::snippets::test_get_three ... ok
test headless::snippets::stateful_deduplicated ... ok
test headless::snippets::test_get_two ... ok
test headless::anyref_heap_live_count::test_anyref_heap_live_count ... ok
test headless::strings::string_roundtrip ... ok

test result: ok. 10 passed; 0 failed; 0 ignored


console.log div contained:
    <script>alert('lol')</script>

     Running target/wasm32-unknown-unknown/debug/deps/non_wasm-07c17dc01af19677.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/wasm-bindgen-test-runner /Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/debug/deps/non_wasm-07c17dc01af19677.wasm`
no tests to run!
     Running target/wasm32-unknown-unknown/debug/deps/std_crate_no_std_dep-e3b83f63f67fea26.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/wasm-bindgen-test-runner /Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/debug/deps/std_crate_no_std_dep-e3b83f63f67fea26.wasm`
no tests to run!
     Running target/wasm32-unknown-unknown/debug/deps/unwrap_throw-2752ece79bbb56e1.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/wasm-bindgen-test-runner /Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/debug/deps/unwrap_throw-2752ece79bbb56e1.wasm`
no tests to run!
     Running target/wasm32-unknown-unknown/debug/deps/wasm-8a9c882db1ee0337.wasm
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/wasm-bindgen-test-runner /Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/debug/deps/wasm-8a9c882db1ee0337.wasm`
running 129 tests                                 

test wasm::api::function_table_is ... ok
test wasm::api::debug_output ... ok
test wasm::api::memory_accessor_appears_to_work ... ok
test wasm::api::null_keeps_working ... ok
test wasm::api::eq_works ... ok
test wasm::api::works ... ok
test wasm::math::limits_correct ... ok
test wasm::math::auto_bind_math ... ok
test wasm::imports::pass_out_options_as_undefined ... ok
test wasm::imports::static_method_of_has_right_this ... ok
test wasm::imports::static_string_ok ... ok
test wasm::imports::undefined_function_is_ok ... ok
test wasm::imports::dead_imports_not_generated ... ok
test wasm::imports::rename_static_with_string ... ok
test wasm::imports::rename_with_string ... ok
wasm-bindgen: imported JS function that was not marked as `catch` threw an error: expected instance of CustomType

Stack:
Error: expected instance of CustomType
    at _assertClass (/Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/wbg-tmp/wasm-bindgen-test.js:312:15)
    at module.exports.__wbg_customtypereturn2_82ba14ae2d228467 (/Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/wbg-tmp/wasm-bindgen-test.js:6705:9)
    at wasm::imports::custom_type_return_2::h1313cd0e25c7e201 (wasm-function[9217]:0x2222f1)
    at wasm::imports::interpret_2_as_custom_type::h5eebe3e895341219 (wasm-function[12607]:0x247d01)
    at interpret_2_as_custom_type (wasm-function[10941]:0x239dad)
    at module.exports.interpret_2_as_custom_type (/Users/tpmccallum/wasm-bindgen/target/wasm32-unknown-unknown/wbg-tmp/wasm-bindgen-test.js:2713:10)
    at getActual (assert.js:638:5)
    at Function.throws (assert.js:778:24)
    at exports.interpret_2_as_custom_type (/Users/tpmccallum/wasm-bindgen/tests/wasm/imports.js:93:10)
    at wasm::imports::js_interpret_2_as_custom_type::h39460ffd7a88495e (wasm-function[11146]:0x23c04e)
test wasm::imports::custom_type ... ok
test wasm::imports::rust_keyword2 ... ok
test wasm::imports::rust_keyword ... ok
test wasm::imports::underscore_pattern ... ok
test wasm::imports::rename ... ok
test wasm::imports::import_a_field ... ok
test wasm::imports::free_imports ... ok
test wasm::imports::exn_caught ... ok
test wasm::imports::exceptions ... ok
test wasm::imports::strings ... ok
test wasm::imports::string_ret ... ok
test wasm::imports::simple ... ok
test wasm::slice::take_clamped ... ok
Received from rust: 0 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 1 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 2 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 3 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 4 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 5 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 6 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 7 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 8 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
Received from rust: 9 Uint32Array [
  1, 2, 3, 4, 5,
  6, 7, 8, 9
]
test wasm::slice::return_vec ... ok
Int8Array [ 1, 2, 3 ]
Int8Array [ 4, 5, 3 ]
Uint8Array [ 1, 2, 3 ]
Uint8Array [ 4, 5, 3 ]
Int16Array [ 1, 2, 3 ]
Int16Array [ 4, 5, 3 ]
Uint16Array [ 1, 2, 3 ]
Uint16Array [ 4, 5, 3 ]
Int32Array [ 1, 2, 3 ]
Int32Array [ 4, 5, 3 ]
Uint32Array [ 1, 2, 3 ]
Uint32Array [ 4, 5, 3 ]
Int32Array [ 1, 2, 3 ]
Int32Array [ 4, 5, 3 ]
Uint32Array [ 1, 2, 3 ]
Uint32Array [ 4, 5, 3 ]
Float32Array [ 1, 2, 3 ]
Float32Array [ 4, 5, 3 ]
Float64Array [ 1, 2, 3 ]
Float64Array [ 4, 5, 3 ]
test wasm::slice::export_mut ... ok
test wasm::slice::import_mut ... ok
test wasm::slice::pass_array ... ok
test wasm::slice::import ... ok
test wasm::slice::export ... ok
test wasm::u64::works ... ok
test wasm::import_class::static_structural ... ok
test wasm::import_class::catch_constructors ... ok
test wasm::import_class::options ... ok
test wasm::import_class::rename_setter_getter ... ok
test wasm::import_class::properties ... ok
test wasm::import_class::rename_type ... ok
test wasm::import_class::new_constructors ... ok
test wasm::import_class::construct ... ok
test wasm::import_class::import_class ... ok
test wasm::import_class::simple ... ok
test wasm::arg_names::rust_arg_names ... ok
test wasm::enums::test_optional_enum_values ... ok
test wasm::enums::test_optional_enums ... ok
test wasm::enums::c_style_enum_with_custom_values ... ok
test wasm::enums::c_style_enum ... ok
test wasm::optional_primitives::works ... ok
test wasm::final_::classes ... ok
test wasm::final_::simple ... ok
test wasm::js_objects::another_vector_return ... ok
test wasm::js_objects::returning_vector ... ok
test wasm::js_objects::promote ... ok
test wasm::js_objects::clone ... ok
test wasm::js_objects::owned ... ok
test wasm::js_objects::simple ... ok
test wasm::char::works ... ok
test wasm::jscast::multiple_layers_of_inheritance ... ok
test wasm::jscast::method_calling ... ok
test wasm::jscast::casting ... ok
test wasm::jscast::instanceof_works ... ok
test wasm::node::works ... ok
test wasm::structural::works ... ok
test wasm::vendor_prefix::polyfill_works ... ok
test wasm::rethrow::ok_works ... ok
test wasm::rethrow::err_works ... ok
test wasm::classes::inspectable_classes_can_override_generated_methods ... ok
test wasm::classes::inspectable_classes ... ok
test wasm::classes::option_class ... ok
test wasm::classes::conditional_bindings ... ok
test wasm::classes::renamed_export ... ok
test wasm::classes::access_fields ... ok
test wasm::classes::rename_function_for_js ... ok
test wasm::classes::double_consume ... ok
test wasm::classes::readonly_fields ... ok
test wasm::classes::using_self ... ok
test wasm::classes::public_fields ... ok
test wasm::classes::empty_structs ... ok
test wasm::classes::constructors ... ok
test wasm::classes::pass_into_js_as_js_class ... ok
test wasm::classes::pass_into_js ... ok
test wasm::classes::pass_one_to_another ... ok
test wasm::classes::exceptions ... ok
test wasm::classes::strings ... ok
test wasm::classes::simple ... ok
test wasm::duplicates::same_function_different_modules ... ok
test wasm::duplicates::same_function_different_locations ... ok
test wasm::getters_and_setters::setter_compute ... ok
test wasm::getters_and_setters::getter_compute ... ok
test wasm::getters_and_setters::_7_rust ... ok
test wasm::getters_and_setters::_6_rust ... ok
test wasm::getters_and_setters::_5_rust ... ok
test wasm::getters_and_setters::_4_rust ... ok
test wasm::getters_and_setters::_3_rust ... ok
test wasm::getters_and_setters::_2_rust ... ok
test wasm::getters_and_setters::_1_rust ... ok
test wasm::variadic::rest_vec ... ok
test wasm::variadic::f64 ... ok
test wasm::variadic::f32 ... ok
test wasm::variadic::i32 ... ok
test wasm::variadic::i16 ... ok
test wasm::variadic::i8 ... ok
test wasm::variadic::u32 ... ok
test wasm::variadic::u16 ... ok
test wasm::variadic::u8 ... ok
test wasm::truthy_falsy::test_is_falsy ... ok
test wasm::truthy_falsy::test_is_truthy ... ok
test wasm::comments::works ... ok
test wasm::simple::anyref_heap_live_count ... ok
test wasm::simple::string_roundtrip ... ok
test wasm::simple::renaming_imports_and_instanceof ... ok
test wasm::simple::optional_slices ... ok
test wasm::simple::binding_to_unimplemented_apis_doesnt_break_everything ... ok
test wasm::simple::jsvalue_typeof ... ok
test wasm::simple::other_exports ... ok
test wasm::simple::wrong_types ... ok
test wasm::simple::return_a_string ... ok
test wasm::simple::string_arguments ... ok
test wasm::simple::add ... ok
test wasm::option::import_by_ref ... ok
test wasm::option::export_by_value ... ok
test wasm::option::import_by_value ... ok
test wasm::validate_prt::works ... ok
test wasm::no_shims::no_shims ... ok
undefined undefined
10 10
test wasm::duplicate_deps::works ... ok
test wasm::futures::smoke ... ok

test result: ok. 129 passed; 0 failed; 0 ignored
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment