Skip to content

Commit

Permalink
wasm-bindgen-test-runner: Updated then steps to work with &Context to…
Browse files Browse the repository at this point in the history
… allow aggregate execution of steps.
  • Loading branch information
spigaz committed May 24, 2024
1 parent 0f78bda commit c285156
Show file tree
Hide file tree
Showing 400 changed files with 428 additions and 406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_wasm_bindgen_test_runner_help_information_feature() {
given_there_is_an_assembly_with_one_failing_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "--help");
then_the_standard_output_should_have(
context,
&context,
r#"Execute all wasm bindgen unit and integration tests and build examples of a local package
Usage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_without_anything(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "--help");
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_wasm_bindgen_test_runner_version_information_feature() {
given_there_is_an_assembly_with_one_failing_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "--version");
then_the_standard_output_should_have(
context,
&context,
&format!("wasm-bindgen-test-runner {}", env!("CARGO_PKG_VERSION")),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_without_anything(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "--version");
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_wasm_bindgen_test_runner_help_information_feature() {
given_there_is_an_assembly_with_one_failing_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "-h");
then_the_standard_output_should_have(
context,
&context,
r#"Execute all wasm bindgen unit and integration tests and build examples of a local package
Usage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_without_anything(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "-h");
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_wasm_bindgen_test_runner_version_information_feature() {
given_there_is_an_assembly_with_one_failing_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "-V");
then_the_standard_output_should_have(
context,
&context,
&format!("wasm-bindgen-test-runner {}", env!("CARGO_PKG_VERSION")),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_without_anything(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_option(&mut context, "-V");
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_its_running_1_test_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(&mut context);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_no_error_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(&mut context);
then_the_standard_error_should_be_empty(context);
then_the_standard_error_should_be_empty(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_assembly_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_successful_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_test::pass ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(&mut context);
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_its_running_1_test_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_firefox(&mut context);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_no_error_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_firefox(&mut context);
then_the_standard_error_should_be_empty(context);
then_the_standard_error_should_be_empty(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_assembly_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_firefox(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_successful_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_firefox(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_test::pass ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_firefox(&mut context);
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_its_running_1_test_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_node(&mut context);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn outputs_no_error_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_node(&mut context);
then_the_standard_error_should_be_empty(context);
then_the_standard_error_should_be_empty(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_assembly_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_node(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn outputs_the_successful_test_summary_feature() {
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_node(&mut context);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_test::pass ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ fn returns_success_feature() {
let mut context = Context::new();
given_there_is_an_assembly_with_one_successful_test(&mut context);
when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_node(&mut context);
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_its_running_1_test_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_failure_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"failures:\n\n assembly_with_one_failing_test::fail",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_failed_test_assertion_error_feature() {
"--include-ignored",
);
then_the_standard_error_should_have(
context,
&context,
"assertion `left == right` failed\n left: 1\n right: 2",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_failed_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_failing_test::fail ... FAIL",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn returns_failure_feature() {
&mut context,
"--include-ignored",
);
then_failure_should_have_been_returned(context);
then_failure_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_its_running_1_test_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_no_error_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_error_should_be_empty(context);
then_the_standard_error_should_be_empty(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_ignored_test_successful_execution_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_ignored_test::ignored ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn returns_success_feature() {
&mut context,
"--include-ignored",
);
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_its_running_1_test_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_output_should_have(context, "running 1 test");
then_the_standard_output_should_have(&context, "running 1 test");
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_no_error_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_error_should_be_empty(context);
then_the_standard_error_should_be_empty(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_ignored_test_successful_execution_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_ignored_with_reason_test::ignored ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn returns_success_feature() {
&mut context,
"--include-ignored",
);
then_success_should_have_been_returned(context);
then_success_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_its_running_2_tests_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_output_should_have(context, "running 2 tests");
then_the_standard_output_should_have(&context, "running 2 tests");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_failure_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"failures:\n\n assembly_with_one_successful_and_one_failing_tests::fail\n",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_failed_test_assertion_error_feature() {
"--include-ignored",
);
then_the_standard_error_should_have(
context,
&context,
"assertion `left == right` failed\n left: 1\n right: 2",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_failed_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_and_one_failing_tests::fail ... FAIL",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_successful_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_and_one_failing_tests::pass ... ok",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn returns_failure_feature() {
&mut context,
"--include-ignored",
);
then_failure_should_have_been_returned(context);
then_failure_should_have_been_returned(&context);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ fn outputs_its_running_2_tests_feature() {
&mut context,
"--include-ignored",
);
then_the_standard_output_should_have(context, "running 2 tests");
then_the_standard_output_should_have(&context, "running 2 tests");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_assembly_test_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test result: ok. 2 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn outputs_the_ignored_test_successful_execution_summary_feature() {
"--include-ignored",
);
then_the_standard_output_should_have(
context,
&context,
"test assembly_with_one_successful_and_one_ignored_tests::ignored ... ok",
);
}
Loading

0 comments on commit c285156

Please sign in to comment.