Skip to content

Commit

Permalink
wasm-bindgen-test-runner: Added test features to the invocation runti…
Browse files Browse the repository at this point in the history
…mes deno with_one_successful_test.
  • Loading branch information
spigaz committed Apr 27, 2024
1 parent fd6d97f commit aac9fe5
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod with_one_successful_test;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod outputs_its_running_1_test_feature;
mod outputs_no_error_feature;
mod outputs_the_assembly_test_summary_feature;
mod outputs_the_successful_test_summary_feature;
mod returns_success_feature;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use crate::__steps__::assembly::given_there_is_an_assembly_with_one_successful_test;
use crate::__steps__::standard_output::then_the_standard_output_should_have;
use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;
use crate::__steps__::Context;

#[test]
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");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use crate::__steps__::assembly::given_there_is_an_assembly_with_one_successful_test;
use crate::__steps__::standard_error::then_the_standard_error_should_be_empty;
use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;
use crate::__steps__::Context;

#[test]
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);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use crate::__steps__::assembly::given_there_is_an_assembly_with_one_successful_test;
use crate::__steps__::standard_output::then_the_standard_output_should_have;
use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;
use crate::__steps__::Context;

#[test]
fn outputs_the_assembly_test_summary_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,
"test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out",
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use crate::__steps__::assembly::given_there_is_an_assembly_with_one_successful_test;
use crate::__steps__::standard_output::then_the_standard_output_should_have;
use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;
use crate::__steps__::Context;

#[test]
fn outputs_the_successful_test_summary_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,
"test assembly_with_one_successful_test::pass ... ok",
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use crate::__steps__::assembly::given_there_is_an_assembly_with_one_successful_test;
use crate::__steps__::success::then_success_should_have_been_returned;
use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;
use crate::__steps__::Context;

#[test]
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);
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mod deno;
mod node;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno;

pub use when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno::*;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use crate::__steps__::{wasm_bindgen_test_runner::wasm_bindgen_test_runner_command, Context};

pub fn when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_targeting_deno(
context: &mut Context,
) {
let mut command = wasm_bindgen_test_runner_command();

command.env("WASM_BINDGEN_USE_DENO", "true");

command.arg(context.sandbox_mut().assembly());

context.output_set(command.output());
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mod deno;
mod node;
mod sandbox;
mod wasm_bindgen_test_runner_command;
Expand All @@ -6,6 +7,7 @@ mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments
mod when_wasm_bindgen_test_runner_is_invoked_with_the_option;
mod when_wasm_bindgen_test_runner_is_invoked_without_arguments;

pub use deno::*;
pub use node::*;
pub use sandbox::*;
pub use wasm_bindgen_test_runner_command::*;
Expand Down

0 comments on commit aac9fe5

Please sign in to comment.