diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0157c230edc..697aa7ee9e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -144,6 +144,9 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20' + - uses: denoland/setup-deno@v1 + with: + deno-version: v1.x - run: cargo test - run: cargo test -p wasm-bindgen-cli-support - run: cargo test -p wasm-bindgen-cli diff --git a/Cargo.toml b/Cargo.toml index c06934617d1..39b2b97e26d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,13 @@ serde_derive = "1.0" wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' } wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' } +[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] +assert_cmd = "1.0" +lazy_static = "1.4.0" +predicates = "1.0.0" +rand = "0.8.5" +regex = "1.10.4" + [workspace] members = [ "benchmarks", diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 8c270186bf7..a8e242e0d6a 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -345,7 +345,8 @@ impl<'a> Context<'a> { }} const wasmInstance = (await WebAssembly.instantiate(wasmCode, imports)).instance; - const wasm = wasmInstance.exports;", + const wasm = wasmInstance.exports; + export const __wasm = wasm;", module_name = module_name ) } diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 8872c8b2797..067b0497851 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -20,6 +20,7 @@ pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }" [dependencies] +clap = { version = "4.5", features = ["derive"] } docopt = "1.0" env_logger = "0.8" anyhow = "1.0" @@ -40,8 +41,11 @@ wasm-bindgen-shared = { path = "../shared", version = "=0.2.92" } [dev-dependencies] assert_cmd = "1.0" diff = "0.1" +lazy_static = "1.4.0" predicates = "1.0.0" +rand = "0.8.5" rayon = "1.0" +regex = "1.10.4" tempfile = "3.0" wasmparser = "0.102.0" wasmprinter = "0.2.54" diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/cli/args.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/args.rs new file mode 100644 index 00000000000..cbcaca90d2b --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/args.rs @@ -0,0 +1,25 @@ +use super::ListArgs; +use super::RunArgs; +use clap::Parser; +use std::path::PathBuf; + +#[derive(Parser, Debug)] +// It would be better to use the default version, but it returns wasm-bindgen-cli instead of wasm-bindgen-test-runner +#[command(about = "Execute all wasm bindgen unit and integration tests and build examples of a local package", version = None, long_about = None)] +#[command( + after_help = "Additional documentation: https://rustwasm.github.io/wasm-bindgen/wasm-bindgen-test/usage.html" +)] +pub struct Args { + /// The wasm file to test + pub input: Option, + + #[command(flatten)] + pub run: RunArgs, + + #[command(flatten)] + pub list: ListArgs, + + /// Print version + #[arg(short = 'V', long)] + pub version: bool, +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/cli/list_args.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/list_args.rs new file mode 100644 index 00000000000..536d668eff8 --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/list_args.rs @@ -0,0 +1,16 @@ +use clap::Args; + +#[derive(Args, Debug)] +pub struct ListArgs { + /// List all tests that would be run + #[arg(long)] + pub list: bool, + + /// Format of the tests listing output + #[arg(long, value_name = "FORMAT", value_parser = ["terse", "json"])] + pub format: Option, + + /// Restricts the listing to only consider the ignored tests + #[arg(long)] + pub ignored: bool, +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/cli/mod.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/mod.rs new file mode 100644 index 00000000000..c82fff3a0fc --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/mod.rs @@ -0,0 +1,7 @@ +mod args; +mod list_args; +mod run_args; + +pub use args::Args; +pub use list_args::ListArgs; +pub use run_args::RunArgs; diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/cli/run_args.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/run_args.rs new file mode 100644 index 00000000000..8161fe2e523 --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/cli/run_args.rs @@ -0,0 +1,52 @@ +use clap::Args; + +#[derive(Args, Debug)] +pub struct RunArgs { + /// If specified, only executes the tests containing [testname] in their names + pub testname: Option, + + /// Run only the test with the exact name + #[arg(long)] + pub exact: bool, + + /// Include ignored tests in the test run + #[arg(long)] + pub include_ignored: bool, + + /// Disables the tests output capture + #[arg(long)] + pub nocapture: bool, + + /// Skip tests whose names match the given pattern + #[arg(long, value_name = "PATTERN", num_args = 0..)] + pub skip: Vec, +} + +impl RunArgs { + pub fn to_args(&self) -> Vec<&str> { + let mut args = Vec::<&str>::new(); + + if let Some(testname) = &self.testname { + args.push(testname); + } + + if self.exact { + args.push("--exact"); + } + + if self.include_ignored { + args.push("--include-ignored"); + } + + if self.nocapture { + args.push("--nocapture"); + } + + for skip in &self.skip { + args.push("--skip"); + args.push(skip); + } + + args + } +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/commands/list.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/list.rs new file mode 100644 index 00000000000..7bfeb8975e5 --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/list.rs @@ -0,0 +1,26 @@ +use anyhow::Result; +use walrus::Module; + +pub fn list(wasm: &Module, ignored: bool) -> Result<()> { + for export in wasm.exports.iter() { + if !export.name.starts_with("__wbgt_") { + continue; + } + + let parts: Vec<&str> = export.name.split('$').collect(); + + if ignored { + if parts.len() == 3 { + let test = parts[1]; + let test = &test[test.find("::").unwrap_or(0) + 2..]; + println!("{}: test", test); + } + } else { + let test = parts[1]; + let test = &test[test.find("::").unwrap_or(0) + 2..]; + println!("{}: test", test); + } + } + + return Ok(()); +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/commands/mod.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/mod.rs new file mode 100644 index 00000000000..be301e1a301 --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/mod.rs @@ -0,0 +1,5 @@ +mod list; +mod version; + +pub use list::list; +pub use version::version; diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/commands/version.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/version.rs new file mode 100644 index 00000000000..432bf696d9f --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/commands/version.rs @@ -0,0 +1,9 @@ +use anyhow::Result; + +pub fn version() -> Result<()> { + println!( + "wasm-bindgen-test-runner {}", + wasm_bindgen_shared::version() + ); + return Ok(()); +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs index a0b05cdbd5b..4ece0d9b886 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/deno.rs @@ -1,4 +1,3 @@ -use std::ffi::OsString; use std::fs; use std::path::Path; use std::process::Command; @@ -7,27 +6,19 @@ use anyhow::{Context, Error}; use crate::node::{exec, SHARED_SETUP}; -pub fn execute( - module: &str, - tmpdir: &Path, - args: &[OsString], - tests: &[String], -) -> Result<(), Error> { +pub fn execute(module: &str, tmpdir: &Path, args: &[&str], tests: &[String]) -> Result<(), Error> { let mut js_to_execute = format!( r#"import * as wasm from "./{0}.js"; {console_override} - // global.__wbg_test_invoke = f => f(); + window.__wbg_test_invoke = f => f(); // Forward runtime arguments. These arguments are also arguments to the // `wasm-bindgen-test-runner` which forwards them to deno which we // forward to the test harness. this is basically only used for test // filters for now. - cx.args(Deno.args.slice(1)); - - const ok = await cx.run(tests.map(n => wasm.__wasm[n])); - if (!ok) Deno.exit(1); + cx.args(Deno.args); const tests = []; "#, @@ -39,6 +30,11 @@ pub fn execute( js_to_execute.push_str(&format!("tests.push('{}')\n", test)); } + js_to_execute.push_str( + r#"const ok = await cx.run(tests.map(n => wasm.__wasm[n])); +if (!ok) Deno.exit(1);"#, + ); + let js_path = tmpdir.join("run.js"); fs::write(&js_path, js_to_execute).context("failed to write JS file")?; diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs index f111902f73f..6fe841e9182 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/headless.rs @@ -1,9 +1,10 @@ +use crate::lock::{is_process_running, Lock}; use crate::shell::Shell; use anyhow::{bail, format_err, Context, Error}; use log::{debug, warn}; use rouille::url::Url; use serde::{Deserialize, Serialize}; -use serde_json::{self, json, Map, Value as Json}; +use serde_json::{json, Map, Value as Json}; use std::env; use std::fs::File; use std::io::{self, Read}; @@ -57,9 +58,13 @@ pub struct LegacyNewSessionParameters { /// will return an error if some tests failed. pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error> { let driver = Driver::find()?; - let mut drop_log: Box = Box::new(|| ()); - let driver_url = match driver.location() { - Locate::Remote(url) => Ok(url.clone()), + let mut client = match driver.location() { + Locate::Remote(url) => Client { + agent: Agent::new(), + driver_url: url.clone(), + session: None, + background_child: None, + }, Locate::Local((path, args)) => { // Allow tests to run in parallel (in theory) by finding any open port // available for our driver. We can't bind the port for the driver, but @@ -70,38 +75,40 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error // threads. We'll print this output later. let mut cmd = Command::new(path); cmd.args(args).arg(format!("--port={}", driver_addr.port())); - let mut child = BackgroundChild::spawn(path, &mut cmd, shell)?; - drop_log = Box::new(move || child.print_stdio_on_drop = false); + + let mut child = BackgroundChild::spawn(path, cmd, shell)?; // Wait for the driver to come online and bind its port before we try to // connect to it. let start = Instant::now(); - let max = Duration::new(5, 0); + let max = Duration::new(10, 0); //safaridriver sometimes refuses to start and has to be restarted let mut bound = false; while start.elapsed() < max { if TcpStream::connect(driver_addr).is_ok() { bound = true; break; } + child.check()?; thread::sleep(Duration::from_millis(100)); } + if !bound { bail!("driver failed to bind port during startup") } - Url::parse(&format!("http://{}", driver_addr)).map_err(Error::from) + Client { + agent: Agent::new(), + driver_url: Url::parse(&format!("http://{}", driver_addr)).map_err(Error::from)?, + session: None, + background_child: Some(child), + } } - }?; + }; println!( "Running headless tests in {} on `{}`", driver.browser(), - driver_url.as_str(), + client.driver_url().as_str(), ); - let mut client = Client { - agent: Agent::new(), - driver_url, - session: None, - }; println!("Try find `webdriver.json` for configure browser's capabilities:"); let capabilities: Capabilities = match File::open("webdriver.json") { Ok(file) => { @@ -180,7 +187,7 @@ pub fn run(server: &SocketAddr, shell: &Shell, timeout: u64) -> Result<(), Error // If the tests harness finished (either successfully or unsuccessfully) // then in theory all the info needed to debug the failure is in its own // output, so we shouldn't need the driver logs to get printed. - drop_log(); + client.drop_log(); } else { println!("Failed to detect test as having been run. It might have timed out."); if !output.is_empty() { @@ -234,12 +241,18 @@ impl Driver { .collect::>() }; - let drivers = [ - ("geckodriver", Driver::Gecko as fn(Locate) -> Driver), - ("safaridriver", Driver::Safari as fn(Locate) -> Driver), - ("chromedriver", Driver::Chrome as fn(Locate) -> Driver), - ("msedgedriver", Driver::Edge as fn(Locate) -> Driver), - ]; + let drivers = match Self::filter().unwrap_or_default().as_str() { + "firefox" => vec![("geckodriver", Driver::Gecko as fn(Locate) -> Driver)], + "safari" => vec![("safaridriver", Driver::Safari as fn(Locate) -> Driver)], + "chrome" => vec![("chromedriver", Driver::Chrome as fn(Locate) -> Driver)], + "edge" => vec![("msedgedriver", Driver::Edge as fn(Locate) -> Driver)], + _ => vec![ + ("geckodriver", Driver::Gecko as fn(Locate) -> Driver), + ("safaridriver", Driver::Safari as fn(Locate) -> Driver), + ("chromedriver", Driver::Chrome as fn(Locate) -> Driver), + ("msedgedriver", Driver::Edge as fn(Locate) -> Driver), + ], + }; // First up, if env vars like GECKODRIVER_REMOTE are present, use those // to allow forcing usage of a particular remote driver. @@ -311,6 +324,41 @@ an issue against rustwasm/wasm-bindgen! ) } + fn filter_generic(name: &str) -> Option { + if let Ok(browser) = env::var(name) { + match browser.to_lowercase().as_str() { + "firefox" | "safari" | "chrome" | "edge" => Some(browser), + "true" => None, + other => { + println!("unknown browser: {} referenced in {}", other, name); + None + } + } + } else { + None + } + } + + /// Checks if a filter for a specific Browser to be used was set + fn filter() -> Option { + let browser = Self::filter_generic("WASM_BINDGEN_USE_BROWSER"); + if browser.is_some() { + return browser; + } + + let browser = Self::filter_generic("WASM_BINDGEN_USE_DEDICATED_WORKER"); + if browser.is_some() { + return browser; + } + + let browser = Self::filter_generic("WASM_BINDGEN_USE_SERVICE_WORKER"); + if browser.is_some() { + return browser; + } + + Self::filter_generic("WASM_BINDGEN_USE_SHARED_WORKER") + } + fn browser(&self) -> &str { match self { Driver::Gecko(_) => "Firefox", @@ -330,10 +378,11 @@ an issue against rustwasm/wasm-bindgen! } } -struct Client { +struct Client<'b> { agent: Agent, driver_url: Url, session: Option, + background_child: Option>, } enum Method<'a> { @@ -346,7 +395,17 @@ enum Method<'a> { // I'm not too familiar with them myself, but these seem to work! I mostly // copied the `webdriver-client` crate when writing the below bindings. -impl Client { +impl<'b> Client<'b> { + fn driver_url(&self) -> &Url { + &self.driver_url + } + + fn drop_log(&mut self) { + if let Some(child) = self.background_child.as_mut() { + child.print_stdio_on_drop = false; + } + } + fn new_session(&mut self, driver: &Driver, mut cap: Capabilities) -> Result { match driver { Driver::Gecko(_) => { @@ -403,7 +462,14 @@ impl Client { "capabilities": { } }); - let x: Response = self.post("/session", &request)?; + let mut x: Result = self.post("/session", &request); + if let Some(_) = self.background_child.as_ref() { + while x.is_err() { + terminate_safari_automation(); + x = self.post("/session", &request); + } + } + let x = x?; Ok(x.clone() .session_id .or_else(|| x.value.map(|v| v.session_id.unwrap())) @@ -582,7 +648,7 @@ impl Client { } } -impl Drop for Client { +impl<'b> Drop for Client<'b> { fn drop(&mut self) { let id = match &self.session { Some(id) => id.clone(), @@ -612,43 +678,86 @@ fn tab(s: &str) -> String { struct BackgroundChild<'a> { child: Child, + cmd: Command, stdout: Option>>>, stderr: Option>>>, shell: &'a Shell, + path: &'a Path, print_stdio_on_drop: bool, + lock: Option, } impl<'a> BackgroundChild<'a> { fn spawn( - path: &Path, - cmd: &mut Command, + path: &'a Path, + mut cmd: Command, shell: &'a Shell, ) -> Result, Error> { + let lock = Self::lock(path)?; + cmd.stdout(Stdio::piped()) .stderr(Stdio::piped()) .stdin(Stdio::null()); + log::debug!("executing {:?}", cmd); + let mut child = cmd .spawn() .context(format!("failed to spawn {:?} binary", path))?; + let mut stdout = child.stdout.take().unwrap(); let mut stderr = child.stderr.take().unwrap(); + let stdout = Some(thread::spawn(move || read(&mut stdout))); let stderr = Some(thread::spawn(move || read(&mut stderr))); + Ok(BackgroundChild { child, + cmd, stdout, stderr, shell, + path, print_stdio_on_drop: true, + lock, }) } + + fn check(&mut self) -> Result<(), Error> { + if is_process_defunct(self.child.id()) { + let mut child = self + .cmd + .spawn() + .context(format!("failed to spawn {:?} binary", self.path))?; + + let mut stdout = child.stdout.take().unwrap(); + let mut stderr = child.stderr.take().unwrap(); + + let stdout = Some(thread::spawn(move || read(&mut stdout))); + let stderr = Some(thread::spawn(move || read(&mut stderr))); + + self.child = child; + self.stdout = stdout; + self.stderr = stderr; + } + + Ok(()) + } + + fn lock(path: &Path) -> Result, Error> { + if path.to_string_lossy().contains("safaridriver") { + Ok(Some(Lock::try_new("safaridriver")?)) + } else { + Ok(None) + } + } } impl<'a> Drop for BackgroundChild<'a> { fn drop(&mut self) { self.child.kill().unwrap(); let status = self.child.wait().unwrap(); + if !self.print_stdio_on_drop { return; } @@ -666,3 +775,69 @@ impl<'a> Drop for BackgroundChild<'a> { } } } + +fn get_safari_automation_pids() -> Vec { + let output = Command::new("pgrep") + .args(&["-f", "Safari --automation"]) + .output() + .ok() + .expect("failed to execute pgrep"); + + if output.stdout.is_empty() { + return Vec::new(); + } + + let pids = String::from_utf8(output.stdout) + .ok() + .expect("failed to parse pgrep output"); + + pids.trim() + .split('\n') + .map(|pid| pid.parse().expect("failed to parse pid")) + .collect() +} + +fn terminate_safari_automation() { + for pid in get_safari_automation_pids() { + terminate_process(pid); + } +} + +fn terminate_process(pid: u32) { + let output = Command::new("kill") + .arg("-15") // SIGTERM + .arg(pid.to_string()) + .output() + .map_err(|e| format!("Failed to execute kill command: {}", e)) + .unwrap(); + + if !output.status.success() { + let error = String::from_utf8_lossy(&output.stderr); + println!("Failed to terminate process: {}", error); + } + + thread::sleep(Duration::from_millis(100)); + + while is_process_running(pid) { + Command::new("kill") + .arg("-9") // SIGKILL + .arg(pid.to_string()) + .output() + .map_err(|e| format!("Failed to execute kill command: {}", e)) + .unwrap(); + + thread::sleep(Duration::from_millis(100)); + } +} + +pub fn is_process_defunct(pid: u32) -> bool { + let output = Command::new("ps") + .arg("-o") + .arg("stat=") + .arg("-p") + .arg(pid.to_string()) + .output() + .expect("Failed to execute ps command"); + + output.stdout.is_empty() || std::str::from_utf8(&output.stdout).unwrap().contains("Z") +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/lock.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/lock.rs new file mode 100644 index 00000000000..090bc94e8fd --- /dev/null +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/lock.rs @@ -0,0 +1,175 @@ +use anyhow::Result; +use std::fs::{hard_link, metadata, read_dir, DirEntry, File, OpenOptions}; +use std::io::Error; +use std::io::{Read, Write}; +use std::path::PathBuf; +use std::process::{id, Command}; +use std::time::Duration; +use std::time::SystemTime; +use std::{env, thread}; + +pub struct Lock { + file: PathBuf, + lock: PathBuf, + name: String, + pid: u32, + timestamp: SystemTime, +} + +impl Lock { + pub fn try_new(name: &str) -> Result { + let pid = id(); + let file = Self::create_file(name, pid)?; + let timestamp = metadata(&file).unwrap().modified().unwrap(); + let mut lock = Self { + file, + lock: Self::create_lock(name)?, + name: name.to_string(), + pid, + timestamp, + }; + lock.aquire()?; + Ok(lock) + } + + fn aquire(&mut self) -> Result<()> { + while !self.try_aquire()? { + thread::sleep(Duration::from_millis(100)); + } + Ok(()) + } + + fn create_file(name: &str, pid: u32) -> Result { + let file = env::temp_dir().join(format!("{}.{}", name, pid)); + + let mut file_handle = OpenOptions::new() + .write(true) + .create(true) + .truncate(true) + .open(&file)?; + + file_handle.write_all(pid.to_string().as_bytes())?; + file_handle.sync_all()?; + + Ok(file) + } + + fn create_lock(name: &str) -> Result { + Ok(env::temp_dir().join(format!("{}.lock", name))) + } + + fn has_lock(&self) -> bool { + if let Ok(pid) = self.read_lock_pid() { + if pid == self.pid { + return true; + } + } + false + } + + fn is_oldest_waiting(&self) -> bool { + let lock_name = format!("{}.lock", &self.name); + let file_prefix = format!("{}.", &self.name); + + for entry in read_dir(env::temp_dir()).unwrap() { + if let Some((path, pid)) = self.is_candidate(entry, &lock_name, &file_prefix) { + if self.is_candidate_older(&path, pid) && is_process_running(pid) { + return false; + } + } + } + + true + } + + fn is_candidate( + &self, + entry: Result, + lock_name: &str, + file_prefix: &str, + ) -> Option<(PathBuf, u32)> { + if let Ok(entry) = entry { + let path = entry.path(); + if let Some(name) = path.clone().file_name().and_then(|n| n.to_str()) { + if name.starts_with(file_prefix) && name != lock_name { + if let Some(pid) = name.split('.').last().and_then(|n| n.parse().ok()) { + if pid != self.pid { + return Some((path, pid)); + } + } + } + } + } + None + } + + fn is_candidate_older(&self, candidate: &PathBuf, pid: u32) -> bool { + if let Ok(metadata) = metadata(candidate) { + if let Ok(modified) = metadata.modified() { + return modified < self.timestamp; + } + } + pid < self.pid + } + + fn read_lock_pid(&self) -> Result { + let mut file = File::open(&self.lock)?; + let mut pid = String::new(); + file.read_to_string(&mut pid)?; + Ok(pid.parse()?) + } + + fn remove_file(&self) { + std::fs::remove_file(&self.file).ok(); + } + + fn remove_lock(&self) { + std::fs::remove_file(&self.lock).ok(); + } + + fn try_aquire(&mut self) -> Result { + if self.lock.exists() { + if let Ok(pid) = self.read_lock_pid() { + if pid == self.pid { + return Ok(true); + } + if is_process_running(pid) { + return Ok(false); + } + } + + self.remove_lock(); + } + + if !self.is_oldest_waiting() { + return Ok(false); + } + + hard_link(&self.file, &self.lock).ok(); + + Ok(self.has_lock()) + } +} + +impl Drop for Lock { + fn drop(&mut self) { + if self.file.exists() { + self.remove_file(); + } + if self.lock.exists() && self.has_lock() { + self.remove_lock(); + } + } +} + +pub fn is_process_running(pid: u32) -> bool { + let output = Command::new("ps") + .arg("-o") + .arg("pid=") + .arg("-p") + .arg(pid.to_string()) + .output() + .expect("Failed to execute ps command"); + + !output.stdout.is_empty() +} diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs index 06d386119ed..e46c278f1f4 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs @@ -11,16 +11,23 @@ //! For more documentation about this see the `wasm-bindgen-test` crate README //! and source code. -use anyhow::{anyhow, bail, Context}; +use anyhow::{anyhow, bail, Context, Result}; +use auroka_common_concurrency_filesystem_resource_coordinator::ResourceCoordinator; +use clap::Parser; +use cli::Args; +use commands::{list, version}; use log::error; use std::env; use std::fs; -use std::path::PathBuf; +use std::path::{PathBuf, MAIN_SEPARATOR}; use std::thread; use wasm_bindgen_cli_support::Bindgen; +mod cli; +mod commands; mod deno; mod headless; +mod lock; mod node; mod server; mod shell; @@ -53,28 +60,37 @@ impl TestMode { | Self::ServiceWorker { no_modules } => no_modules, } } -} - -struct TmpDirDeleteGuard(PathBuf); -impl Drop for TmpDirDeleteGuard { - fn drop(&mut self) { - if let Err(e) = fs::remove_dir_all(&self.0) { - error!("failed to remove temporary directory: {}", e); + fn summary(self) -> &'static str { + match self { + Self::Node => "node", + Self::Deno => "deno", + Self::Browser { .. } + | Self::DedicatedWorker { .. } + | Self::SharedWorker { .. } + | Self::ServiceWorker { .. } => { + if self.no_modules() { + "no_modules" + } else { + "web" + } + } } } } fn main() -> anyhow::Result<()> { env_logger::init(); - let mut args = env::args_os().skip(1); - let shell = shell::Shell::new(); + let args = Args::parse(); - // Currently no flags are supported, and assume there's only one argument - // which is the wasm file to test. This'll want to improve over time! - let wasm_file_to_test = match args.next() { - Some(file) => PathBuf::from(file), - None => bail!("must have a file to test as first argument"), + if args.version { + return version(); + } + + let wasm_file_to_test: PathBuf = if let Some(input) = args.input { + input + } else { + bail!("must have a file to test as first argument"); }; let file_name = wasm_file_to_test @@ -82,40 +98,18 @@ fn main() -> anyhow::Result<()> { .and_then(|s| s.to_str()) .context("file to test is not a valid file, can't extract file name")?; - // wasm_file_to_test may be - // - a cargo-like directory layout and generate output at - // `target/wasm32-unknown-unknown/...` - // - a tmp directory, generated by rustdoc - // we would like a directory we have write access to. if we assume cargo-like directories, - // we end up with the path `/wbg-out` - let wasm_file_str = wasm_file_to_test.to_string_lossy(); - let tmpdir = - if wasm_file_str.starts_with("/tmp/rustdoc") || wasm_file_str.starts_with("/var/folders") { - wasm_file_to_test.parent() // chop off the file name and give us the /tmp/rustdoc directory - } else { - wasm_file_to_test - .parent() // chop off file name - .and_then(|p| p.parent()) // chop off `deps` - .and_then(|p| p.parent()) // chop off `debug` - } - .map(|p| p.join(format!("wbg-tmp-{}", file_name))) - .ok_or_else(|| anyhow!("file to test doesn't follow the expected Cargo conventions"))?; - - // Make sure there's no stale state from before - drop(fs::remove_dir_all(&tmpdir)); - fs::create_dir(&tmpdir).context("creating temporary directory")?; - let _guard = TmpDirDeleteGuard(tmpdir.clone()); + let wasm = fs::read(&wasm_file_to_test).context("failed to read wasm file")?; + let mut wasm = + walrus::Module::from_buffer(&wasm).context("failed to deserialize wasm module")?; - let module = "wasm-bindgen-test"; + if args.list.list { + return list(&wasm, args.list.ignored); + } + let mut tests = Vec::new(); // Collect all tests that the test harness is supposed to run. We assume // that any exported function with the prefix `__wbg_test` is a test we need // to execute. - let wasm = fs::read(&wasm_file_to_test).context("failed to read wasm file")?; - let mut wasm = - walrus::Module::from_buffer(&wasm).context("failed to deserialize wasm module")?; - let mut tests = Vec::new(); - for export in wasm.exports.iter() { if !export.name.starts_with("__wbgt_") { continue; @@ -152,6 +146,24 @@ fn main() -> anyhow::Result<()> { }, Some(_) => bail!("invalid __wasm_bingen_test_unstable value"), None if std::env::var("WASM_BINDGEN_USE_DENO").is_ok() => TestMode::Deno, + None if std::env::var("WASM_BINDGEN_USE_BROWSER").is_ok() => TestMode::Browser { + no_modules: std::env::var("WASM_BINDGEN_USE_NO_MODULE").is_ok(), + }, + None if std::env::var("WASM_BINDGEN_USE_DEDICATED_WORKER").is_ok() => { + TestMode::DedicatedWorker { + no_modules: std::env::var("WASM_BINDGEN_USE_NO_MODULE").is_ok(), + } + } + None if std::env::var("WASM_BINDGEN_USE_SERVICE_WORKER").is_ok() => { + TestMode::DedicatedWorker { + no_modules: std::env::var("WASM_BINDGEN_USE_NO_MODULE").is_ok(), + } + } + None if std::env::var("WASM_BINDGEN_USE_SHARED_WORKER").is_ok() => { + TestMode::DedicatedWorker { + no_modules: std::env::var("WASM_BINDGEN_USE_NO_MODULE").is_ok(), + } + } None => TestMode::Node, }; @@ -184,6 +196,97 @@ fn main() -> anyhow::Result<()> { return Ok(()); } + let module = "wasm-bindgen-test"; + + // wasm_file_to_test may be + // - a cargo-like directory layout and generate output at + // `target/wasm32-unknown-unknown/...` + // - a tmp directory, generated by rustdoc + // we would like a directory we have write access to. if we assume cargo-like directories, + // we end up with the path `/wbg-out` + let wasm_file_str = wasm_file_to_test.to_string_lossy(); + let mut tmp = format!("wbg-tmp-{}-{}", file_name, test_mode.summary()); + if debug { + tmp += "-debug"; + } + if std::env::var("WASM_BINDGEN_SPLIT_LINKED_MODULES").is_ok() { + tmp += "-split"; + } + let tmpdir = + if wasm_file_str.starts_with("/tmp/rustdoc") || wasm_file_str.starts_with("/var/folders") { + wasm_file_to_test.parent() // chop off the file name and give us the /tmp/rustdoc directory + } else { + wasm_file_to_test + .parent() // chop off file name + .and_then(|p| p.parent()) // chop off `deps` + .and_then(|p| p.parent()) // chop off `debug` + } + .map(|p| p.join(tmp.clone())) + .ok_or_else(|| anyhow!("file to test doesn't follow the expected Cargo conventions"))?; + + let shell = shell::Shell::new(); + + let lock_name = tmpdir.display().to_string().replace(MAIN_SEPARATOR, "_"); + + let mut resource_coordinator = ResourceCoordinator::new(lock_name); + + resource_coordinator.initialize_set({ + let shell = shell.clone(); + let tmpdir = tmpdir.clone(); + move || -> Result<()> { + // Make sure there's no stale state from before + drop(fs::remove_dir_all(&tmpdir)); + fs::create_dir(&tmpdir).context("creating temporary directory")?; + + // Make the generated bindings available for the tests to execute against. + shell.status("Executing bindgen..."); + + let mut b = Bindgen::new(); + match test_mode { + TestMode::Node => b.nodejs(true)?, + TestMode::Deno => b.deno(true)?, + TestMode::Browser { .. } + | TestMode::DedicatedWorker { .. } + | TestMode::SharedWorker { .. } + | TestMode::ServiceWorker { .. } => { + if test_mode.no_modules() { + b.no_modules(true)? + } else { + b.web(true)? + } + } + }; + + if std::env::var("WASM_BINDGEN_SPLIT_LINKED_MODULES").is_ok() { + b.split_linked_modules(true); + } + + b.debug(debug) + .input_module(module, wasm) + .keep_debug(false) + .emit_start(false) + .generate(&tmpdir) + .context("executing `wasm-bindgen` over the wasm file")?; + + shell.clear(); + + Ok(()) + } + }); + + resource_coordinator.finalize_set({ + let tmpdir = tmpdir.clone(); + move || { + if fs::exists(&tmpdir).unwrap() { + if let Err(e) = fs::remove_dir_all(&tmpdir) { + error!("failed to remove temporary directory: {}", e); + } + } + } + }); + + resource_coordinator.enter()?; + let timeout = env::var("WASM_BINDGEN_TEST_TIMEOUT") .map(|timeout| { timeout @@ -196,37 +299,7 @@ fn main() -> anyhow::Result<()> { println!("Set timeout to {} seconds...", timeout); } - // Make the generated bindings available for the tests to execute against. - shell.status("Executing bindgen..."); - let mut b = Bindgen::new(); - match test_mode { - TestMode::Node => b.nodejs(true)?, - TestMode::Deno => b.deno(true)?, - TestMode::Browser { .. } - | TestMode::DedicatedWorker { .. } - | TestMode::SharedWorker { .. } - | TestMode::ServiceWorker { .. } => { - if test_mode.no_modules() { - b.no_modules(true)? - } else { - b.web(true)? - } - } - }; - - if std::env::var("WASM_BINDGEN_SPLIT_LINKED_MODULES").is_ok() { - b.split_linked_modules(true); - } - - b.debug(debug) - .input_module(module, wasm) - .keep_debug(false) - .emit_start(false) - .generate(&tmpdir) - .context("executing `wasm-bindgen` over the wasm file")?; - shell.clear(); - - let args: Vec<_> = args.collect(); + let args: Vec<_> = args.run.to_args(); match test_mode { TestMode::Node => node::execute(module, &tmpdir, &args, &tests)?, diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs index c90d00251ba..76e3446f4d3 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/node.rs @@ -1,5 +1,4 @@ use std::env; -use std::ffi::OsString; use std::fs; use std::path::Path; use std::process::Command; @@ -30,7 +29,7 @@ wrap("info"); wrap("warn"); wrap("error"); -cx = new wasm.WasmBindgenTestContext(); +const cx = new wasm.WasmBindgenTestContext(); handlers.on_console_debug = wasm.__wbgtest_console_debug; handlers.on_console_log = wasm.__wbgtest_console_log; handlers.on_console_info = wasm.__wbgtest_console_info; @@ -38,12 +37,7 @@ handlers.on_console_warn = wasm.__wbgtest_console_warn; handlers.on_console_error = wasm.__wbgtest_console_error; "#; -pub fn execute( - module: &str, - tmpdir: &Path, - args: &[OsString], - tests: &[String], -) -> Result<(), Error> { +pub fn execute(module: &str, tmpdir: &Path, args: &[&str], tests: &[String]) -> Result<(), Error> { let mut js_to_execute = format!( r#" const {{ exit }} = require('process'); @@ -117,7 +111,10 @@ pub fn execute( #[cfg(unix)] pub fn exec(cmd: &mut Command) -> Result<(), Error> { use std::os::unix::prelude::*; - Err(Error::from(cmd.exec()).context("failed to execute `node`")) + Err(Error::from(cmd.exec()).context(format!( + "failed to execute `{}`", + cmd.get_program().to_string_lossy() + ))) } #[cfg(windows)] diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs index 9c434a00010..0130e2764d5 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/server.rs @@ -1,5 +1,4 @@ use std::borrow::Cow; -use std::ffi::OsString; use std::fs; use std::net::SocketAddr; use std::path::Path; @@ -14,7 +13,7 @@ pub(crate) fn spawn( headless: bool, module: &'static str, tmpdir: &Path, - args: &[OsString], + args: &[&str], tests: &[String], test_mode: TestMode, isolate_origin: bool, diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/shell.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/shell.rs index f6893fb76de..5a256198c4e 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/shell.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/shell.rs @@ -2,6 +2,7 @@ const WIDTH: usize = 50; use std::io::{self, Write}; +#[derive(Clone)] pub struct Shell {} impl Shell { diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__data__/test_mode.rs b/crates/cli/tests/wasm_bindgen_test_runner/__data__/test_mode.rs new file mode 100644 index 00000000000..80c20931676 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__data__/test_mode.rs @@ -0,0 +1,11 @@ +enum TestMode { + Default, + Deno, + Node, + BrowserDefault, + BrowserChrome, + BrowserEdge, + BrowserFirefox, + #[cfg(host_os = "macos")] + BrowserSafari, +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/mod.rs new file mode 100644 index 00000000000..03cc75612ff --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/mod.rs @@ -0,0 +1,5 @@ +mod options; +mod runtimes; +mod test_mode; +mod with_an_assembly; +mod without_arguments; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/mod.rs new file mode 100644 index 00000000000..cf94f06384b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/mod.rs @@ -0,0 +1 @@ +mod outputs_the_help_information_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/outputs_the_help_information_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/outputs_the_help_information_feature.rs new file mode 100644 index 00000000000..00afca13ccf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__help/outputs_the_help_information_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_option; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + when_wasm_bindgen_test_runner_is_invoked_with_the_option("--help"); + + "Outputs the wasm-bindgen-test-runner help information" { + then_the_standard_output_should_have( + r#"Execute all wasm bindgen unit and integration tests and build examples of a local package + +Usage: wasm-bindgen-test-runner [OPTIONS] [INPUT] [TESTNAME] + +Arguments: + [INPUT] The wasm file to test + [TESTNAME] If specified, only executes the tests containing [testname] in their names + +Options: + --exact Run only the test with the exact name + --include-ignored Include ignored tests in the test run + --nocapture Disables the tests output capture + --skip [...] Skip tests whose names match the given pattern + --list List all tests that would be run + --format Format of the tests listing output [possible values: terse, json] + --ignored Restricts the listing to only consider the ignored tests + -V, --version Print version + -h, --help Print help + +Additional documentation: https://rustwasm.github.io/wasm-bindgen/wasm-bindgen-test/usage.html +"#, + ); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/mod.rs new file mode 100644 index 00000000000..bf4a3a88823 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/mod.rs @@ -0,0 +1 @@ +mod outputs_the_version_information_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/outputs_the_version_information_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/outputs_the_version_information_feature.rs new file mode 100644 index 00000000000..33183aa4324 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/__version/outputs_the_version_information_feature.rs @@ -0,0 +1,17 @@ +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_option; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + when_wasm_bindgen_test_runner_is_invoked_with_the_option("--version"); + + "Outputs the wasm-bindgen-test-runner version information" { + then_the_standard_output_should_have(&format!("wasm-bindgen-test-runner {}", env!("CARGO_PKG_VERSION"))); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/mod.rs new file mode 100644 index 00000000000..cf94f06384b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/mod.rs @@ -0,0 +1 @@ +mod outputs_the_help_information_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/outputs_the_help_information_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/outputs_the_help_information_feature.rs new file mode 100644 index 00000000000..09b437b96b4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_h/outputs_the_help_information_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_option; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + when_wasm_bindgen_test_runner_is_invoked_with_the_option("-h"); + + "Outputs the wasm-bindgen-test-runner help information" { + then_the_standard_output_should_have( + r#"Execute all wasm bindgen unit and integration tests and build examples of a local package + +Usage: wasm-bindgen-test-runner [OPTIONS] [INPUT] [TESTNAME] + +Arguments: + [INPUT] The wasm file to test + [TESTNAME] If specified, only executes the tests containing [testname] in their names + +Options: + --exact Run only the test with the exact name + --include-ignored Include ignored tests in the test run + --nocapture Disables the tests output capture + --skip [...] Skip tests whose names match the given pattern + --list List all tests that would be run + --format Format of the tests listing output [possible values: terse, json] + --ignored Restricts the listing to only consider the ignored tests + -V, --version Print version + -h, --help Print help + +Additional documentation: https://rustwasm.github.io/wasm-bindgen/wasm-bindgen-test/usage.html +"#, + ); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/mod.rs new file mode 100644 index 00000000000..bf4a3a88823 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/mod.rs @@ -0,0 +1 @@ +mod outputs_the_version_information_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/outputs_the_version_information_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/outputs_the_version_information_feature.rs new file mode 100644 index 00000000000..cc60293b664 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/_v/outputs_the_version_information_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_option; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + when_wasm_bindgen_test_runner_is_invoked_with_the_option("-V"); + + "Outputs the wasm-bindgen-test-runner version information" { + then_the_standard_output_should_have( + &format!("wasm-bindgen-test-runner {}", env!("CARGO_PKG_VERSION")), + ); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/mod.rs new file mode 100644 index 00000000000..7ecd3f18e40 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/options/mod.rs @@ -0,0 +1,4 @@ +mod __help; +mod __version; +mod _h; +mod _v; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/executes_test_feature.rs new file mode 100644 index 00000000000..8eb9c525a5f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserChrome); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/chrome/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/executes_test_feature.rs new file mode 100644 index 00000000000..8ec91b435a4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::Deno); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/deno/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/executes_test_feature.rs new file mode 100644 index 00000000000..aa9e607d29c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserEdge); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/edge/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/executes_test_feature.rs new file mode 100644 index 00000000000..fce82419351 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserFirefox); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/firefox/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/mod.rs new file mode 100644 index 00000000000..ba9dca08e91 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/mod.rs @@ -0,0 +1,6 @@ +mod chrome; +mod deno; +mod edge; +mod firefox; +mod node; +mod safari; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/executes_test_feature.rs new file mode 100644 index 00000000000..acb18d2928c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::Node); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/node/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/executes_test_feature.rs new file mode 100644 index 00000000000..5d7b34b9757 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/executes_test_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +#[cfg(target_os = "macos")] +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserSafari); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/runtimes/safari/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/executes_test_feature.rs new file mode 100644 index 00000000000..8eb9c525a5f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserChrome); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/chrome/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/executes_test_feature.rs new file mode 100644 index 00000000000..b42a40cdb5c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserDefault); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/default/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/executes_test_feature.rs new file mode 100644 index 00000000000..aa9e607d29c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserEdge); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/edge/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/executes_test_feature.rs new file mode 100644 index 00000000000..fce82419351 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserFirefox); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/firefox/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/mod.rs new file mode 100644 index 00000000000..63257ffc749 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/mod.rs @@ -0,0 +1,5 @@ +mod chrome; +mod default; +mod edge; +mod firefox; +mod safari; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/executes_test_feature.rs new file mode 100644 index 00000000000..5d7b34b9757 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/executes_test_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +#[cfg(target_os = "macos")] +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::BrowserSafari); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/browser/safari/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/executes_test_feature.rs new file mode 100644 index 00000000000..d091f8e0a62 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::DedicatedWorkerChrome); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/chrome/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/executes_test_feature.rs new file mode 100644 index 00000000000..3c1b5a5a733 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::DedicatedWorkerDefault); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/default/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/executes_test_feature.rs new file mode 100644 index 00000000000..1d813f5564f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::DedicatedWorkerEdge); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/edge/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/executes_test_feature.rs new file mode 100644 index 00000000000..49ecedf8af9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::DedicatedWorkerFirefox); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/firefox/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/mod.rs new file mode 100644 index 00000000000..63257ffc749 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/mod.rs @@ -0,0 +1,5 @@ +mod chrome; +mod default; +mod edge; +mod firefox; +mod safari; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/executes_test_feature.rs new file mode 100644 index 00000000000..b9e7a0ccad4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/executes_test_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +#[cfg(target_os = "macos")] +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::DedicatedWorkerSafari); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/dedicated_worker/safari/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/executes_test_feature.rs new file mode 100644 index 00000000000..033d99e1205 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::Default); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/default/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/executes_test_feature.rs new file mode 100644 index 00000000000..8ec91b435a4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::Deno); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/deno/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/mod.rs new file mode 100644 index 00000000000..b2bd7d749df --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/mod.rs @@ -0,0 +1,7 @@ +mod browser; +mod dedicated_worker; +mod default; +mod deno; +mod node; +mod service_worker; +mod shared_worker; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/executes_test_feature.rs new file mode 100644 index 00000000000..acb18d2928c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::Node); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/node/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/executes_test_feature.rs new file mode 100644 index 00000000000..8a387713b02 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::ServiceWorkerChrome); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/chrome/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/executes_test_feature.rs new file mode 100644 index 00000000000..6dd3faa3944 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::ServiceWorkerDefault); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/default/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/executes_test_feature.rs new file mode 100644 index 00000000000..e8ea0699db4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::ServiceWorkerEdge); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/edge/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/executes_test_feature.rs new file mode 100644 index 00000000000..ed006067b7c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::ServiceWorkerFirefox); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/firefox/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/mod.rs new file mode 100644 index 00000000000..63257ffc749 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/mod.rs @@ -0,0 +1,5 @@ +mod chrome; +mod default; +mod edge; +mod firefox; +mod safari; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/executes_test_feature.rs new file mode 100644 index 00000000000..cbe739453ce --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/executes_test_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +#[cfg(target_os = "macos")] +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::ServiceWorkerSafari); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/service_worker/safari/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/executes_test_feature.rs new file mode 100644 index 00000000000..e8c9787e7bf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::SharedWorkerChrome); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/chrome/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/executes_test_feature.rs new file mode 100644 index 00000000000..d371bddd60d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::SharedWorkerDefault); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/default/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/executes_test_feature.rs new file mode 100644 index 00000000000..c37f37f58fc --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::SharedWorkerEdge); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/edge/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/executes_test_feature.rs new file mode 100644 index 00000000000..7df03964f15 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/executes_test_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::SharedWorkerFirefox); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/firefox/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/mod.rs new file mode 100644 index 00000000000..63257ffc749 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/mod.rs @@ -0,0 +1,5 @@ +mod chrome; +mod default; +mod edge; +mod firefox; +mod safari; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/executes_test_feature.rs new file mode 100644 index 00000000000..29ccfa3cb56 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/executes_test_feature.rs @@ -0,0 +1,39 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +#[cfg(target_os = "macos")] +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(TestMode::SharedWorkerSafari); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/test_mode/shared_worker/safari/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/mod.rs new file mode 100644 index 00000000000..b47b1f57f63 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/mod.rs @@ -0,0 +1,2 @@ +mod with_arguments; +mod without_arguments; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/mod.rs new file mode 100644 index 00000000000..4ca47c84090 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/mod.rs @@ -0,0 +1,6 @@ +mod with_one_failing_test; +mod with_one_ignored_test; +mod with_one_ignored_with_reason_test; +mod with_one_successful_and_one_failing_tests; +mod with_one_successful_and_one_ignored_tests; +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/executes_failing_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/executes_failing_test_feature.rs new file mode 100644 index 00000000000..62e24072211 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/executes_failing_test_feature.rs @@ -0,0 +1,43 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::error_code::then_failure_should_have_been_returned; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the failed test summary" { + then_the_standard_output_should_have("test assembly::fail ... FAIL"); + } + + "Outputs the failed test assertion error" { + then_the_standard_output_should_have("assertion `left == right` failed\n left: 1\n right: 2"); + } + + "Outputs the assembly failure summary" { + then_the_standard_output_should_have("failures:\n\n assembly::fail"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 filtered out"); + } + + "Returns failure" { + then_failure_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/mod.rs new file mode 100644 index 00000000000..c20d0badafb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_failing_test/mod.rs @@ -0,0 +1 @@ +mod executes_failing_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/executes_ignored_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/executes_ignored_test_feature.rs new file mode 100644 index 00000000000..5449862556d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/executes_ignored_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the ignored test successful execution summary" { + then_the_standard_output_should_have("test assembly::ignored ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..069b3d7ad57 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod executes_ignored_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/executes_ignored_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/executes_ignored_test_feature.rs new file mode 100644 index 00000000000..b36a61dfc11 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/executes_ignored_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore = "test"] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the ignored test successful execution summary" { + then_the_standard_output_should_have("test assembly::ignored ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/mod.rs new file mode 100644 index 00000000000..069b3d7ad57 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_ignored_with_reason_test/mod.rs @@ -0,0 +1 @@ +mod executes_ignored_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/executes_successful_and_failing_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/executes_successful_and_failing_tests_feature.rs new file mode 100644 index 00000000000..2a3e9f11329 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/executes_successful_and_failing_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::error_code::then_failure_should_have_been_returned; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the failed test summary" { + then_the_standard_output_should_have("test assembly::fail ... FAIL"); + } + + "Outputs the failed test assertion error" { + then_the_standard_output_should_have("assertion `left == right` failed\n left: 1\n right: 2"); + } + + "Outputs the assembly failure summary" { + then_the_standard_output_should_have("failures:\n\n assembly::fail\n"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have( "test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 filtered out"); + } + + "Returns failure" { + then_failure_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs new file mode 100644 index 00000000000..e448a065d5a --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs @@ -0,0 +1 @@ +mod executes_successful_and_failing_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/executes_successful_and_ignored_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/executes_successful_and_ignored_tests_feature.rs new file mode 100644 index 00000000000..450448fa5a6 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/executes_successful_and_ignored_tests_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the ignored test summary" { + then_the_standard_output_should_have("test assembly::ignored ... ok"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 2 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..0ade722ef00 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod executes_successful_and_ignored_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..48029905c0e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--include-ignored"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/level_0/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/mod.rs new file mode 100644 index 00000000000..c287a1a3df5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__include_ignored/mod.rs @@ -0,0 +1 @@ +mod level_0; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/mod.rs new file mode 100644 index 00000000000..74919297df5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/mod.rs @@ -0,0 +1,4 @@ +mod with_one_ignored_test; +mod with_one_ignored_with_reason_test; +mod with_one_successful_and_one_failing_tests; +mod with_one_successful_and_one_ignored_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..7c108008cde --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,25 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..1258a65a3a1 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,25 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore = "test"] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_ignored_with_reason_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs new file mode 100644 index 00000000000..ca2ea559dbb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs @@ -0,0 +1,29 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_be_empty; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs nothing" { + then_the_standard_output_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs new file mode 100644 index 00000000000..4dab07680fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_failing_tests/mod.rs @@ -0,0 +1 @@ +mod lists_nothing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..0830e99311b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,30 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_0/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/mod.rs new file mode 100644 index 00000000000..f340801fa96 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/mod.rs @@ -0,0 +1,3 @@ +mod with_one_ignored_test; +mod with_one_successful_and_one_failing_test; +mod with_one_successful_and_one_ignored_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..0266ae1b942 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,30 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[cfg(test)] + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/lists_nothing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/lists_nothing_feature.rs new file mode 100644 index 00000000000..f59dccc1c22 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/lists_nothing_feature.rs @@ -0,0 +1,33 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_be_empty; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn fail() { + assert_eq!(1, 2); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs nothing" { + then_the_standard_output_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/mod.rs new file mode 100644 index 00000000000..4dab07680fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_failing_test/mod.rs @@ -0,0 +1 @@ +mod lists_nothing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..0ef8af6ac87 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,34 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_1/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/mod.rs new file mode 100644 index 00000000000..248266f43f5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/mod.rs @@ -0,0 +1,3 @@ +mod with_one_ignored_test; +mod with_one_successful_and_one_failing_tests; +mod with_one_successful_and_one_ignored_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..ba46301d576 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,32 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[cfg(test)] + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have("level_1::level_2::ignored: test"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs new file mode 100644 index 00000000000..268ab600359 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/lists_nothing_feature.rs @@ -0,0 +1,37 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_be_empty; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[cfg(test)] + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[cfg(test)] + #[wasm_bindgen_test] + fn fail() { + assert_eq!(1, 2); + } + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs nothing" { + then_the_standard_output_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/mod.rs new file mode 100644 index 00000000000..4dab07680fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_failing_tests/mod.rs @@ -0,0 +1 @@ +mod lists_nothing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..07bb665af27 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,36 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have("level_1::level_2::ignored: test"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/level_2/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/mod.rs new file mode 100644 index 00000000000..a2590091967 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/mod.rs @@ -0,0 +1,4 @@ +mod level_0; +mod level_1; +mod level_2; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/lists_nothing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/lists_nothing_feature.rs new file mode 100644 index 00000000000..afa5d5562b6 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/lists_nothing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_be_empty; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse --ignored"); + + "Outputs nothing" { + then_the_standard_output_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/mod.rs new file mode 100644 index 00000000000..4dab07680fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/__ignored/without_tests/mod.rs @@ -0,0 +1 @@ +mod lists_nothing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/mod.rs new file mode 100644 index 00000000000..74919297df5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/mod.rs @@ -0,0 +1,4 @@ +mod with_one_ignored_test; +mod with_one_ignored_with_reason_test; +mod with_one_successful_and_one_failing_tests; +mod with_one_successful_and_one_ignored_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..2af6df8af0e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,25 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have("ignored: test"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..cef6b9272ce --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,25 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore = "test"] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have("ignored: test"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_ignored_with_reason_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..9a12eaf0a63 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,30 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"pass: test +fail: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_failing_tests/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..db171dca402 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,31 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"pass: test +ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_0/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/mod.rs new file mode 100644 index 00000000000..ccd2436f99d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/mod.rs @@ -0,0 +1,3 @@ +mod with_one_successful_and_one_failing_test; +mod with_one_successful_and_one_ignored_test; +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..da239d3fa0c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,34 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn fail() { + assert_eq!(1, 2); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::pass: test +level_1::fail: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_failing_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..f38cb4993a0 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,35 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Ouputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::pass: test +level_1::ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_and_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..26e537592b5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,28 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::pass: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_1/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/mod.rs new file mode 100644 index 00000000000..ccd2436f99d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/mod.rs @@ -0,0 +1,3 @@ +mod with_one_successful_and_one_failing_test; +mod with_one_successful_and_one_ignored_test; +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..af86d17f899 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,38 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[cfg(test)] + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[cfg(test)] + #[wasm_bindgen_test] + fn fail() { + assert_eq!(1, 2); + } + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Ouputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::level_2::pass: test +level_1::level_2::fail: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_failing_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..ee08bf3e4ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/lists_the_tests_in_the_terse_format_feature.rs @@ -0,0 +1,37 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + #[ignore] + fn ignored() { + assert_eq!(1, 1); + } + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have(r#"level_1::level_2::pass: test +level_1::level_2::ignored: test"#); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/mod.rs new file mode 100644 index 00000000000..d82787ea767 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_and_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_tests_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs new file mode 100644 index 00000000000..0aea3af3b8f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/lists_the_test_in_the_terse_format_feature.rs @@ -0,0 +1,29 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + } +}"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs the test in the terse format" { + then_the_standard_output_should_have("level_1::level_2::pass: test"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..d05380e92ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/level_2/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod lists_the_test_in_the_terse_format_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/mod.rs new file mode 100644 index 00000000000..a2590091967 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/mod.rs @@ -0,0 +1,4 @@ +mod level_0; +mod level_1; +mod level_2; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/lists_nothing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/lists_nothing_feature.rs new file mode 100644 index 00000000000..5649ee8e954 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/lists_nothing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_be_empty; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--list --format terse"); + + "Outputs nothing" { + then_the_standard_output_should_be_empty(); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/mod.rs new file mode 100644 index 00000000000..4dab07680fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/default/without_tests/mod.rs @@ -0,0 +1 @@ +mod lists_nothing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/mod.rs new file mode 100644 index 00000000000..e505b9b3dfd --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/__format_terse/mod.rs @@ -0,0 +1,2 @@ +mod __ignored; +mod default; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/mod.rs new file mode 100644 index 00000000000..e418dac0297 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__list/mod.rs @@ -0,0 +1 @@ +mod __format_terse; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/mod.rs new file mode 100644 index 00000000000..60167028c54 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/mod.rs @@ -0,0 +1,6 @@ +mod with_one_full_match_successful_test; +mod with_one_partial_match_successful_test; +mod with_one_prefix_match_successful_test; +mod with_one_suffix_match_successful_test; +mod with_two_partial_match_successful_tests; +mod without_match_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..617d4690afa --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pass"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..45823e653af --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=as"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..73dfb10f525 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pa"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..ecffde4bae9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=ss"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..a8302000be9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pass"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/mod.rs new file mode 100644 index 00000000000..808935399e4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs new file mode 100644 index 00000000000..6edece0140e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pattern"); + + "Outputs the successful test information" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/mod.rs new file mode 100644 index 00000000000..60167028c54 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/mod.rs @@ -0,0 +1,6 @@ +mod with_one_full_match_successful_test; +mod with_one_partial_match_successful_test; +mod with_one_prefix_match_successful_test; +mod with_one_suffix_match_successful_test; +mod with_two_partial_match_successful_tests; +mod without_match_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..524bfd79952 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=level_1::pass"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..d97ca841e92 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=1::"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..6bb57a9b544 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=level_1"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..88f5809810f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=ss"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..85b3fac3ad2 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pass"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/mod.rs new file mode 100644 index 00000000000..808935399e4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs new file mode 100644 index 00000000000..cb9a3b77d72 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs @@ -0,0 +1,44 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pattern"); + + "Outputs the successful test information" { + then_the_standard_output_should_have("test assembly::level_1::pass ... ok"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..d796530f052 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_1/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--skip=pattern"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..9f84875a1ad --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pass_1 --skip=pass_2"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..41154a138bb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=pass_1 --skip=level_1"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..dc9cec6d4b8 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_2/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--skip=pattern1 --skip=pattern2"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..734aa0f1eae --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip=fail --skip=pass_1 --skip=pass_2"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..ed1c6e34f5f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip fail --skip pass_1 --skip level_1"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..b5e2264f575 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/count_3/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments( "--skip=pattern1 --skip=pattern2 --skip=pattern3"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/mod.rs new file mode 100644 index 00000000000..4436fd24ae0 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_eq_pattern/mod.rs @@ -0,0 +1,3 @@ +mod count_1; +mod count_2; +mod count_3; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/mod.rs new file mode 100644 index 00000000000..60167028c54 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/mod.rs @@ -0,0 +1,6 @@ +mod with_one_full_match_successful_test; +mod with_one_partial_match_successful_test; +mod with_one_prefix_match_successful_test; +mod with_one_suffix_match_successful_test; +mod with_two_partial_match_successful_tests; +mod without_match_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..e16d6464717 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_full_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pass"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..4bef2b62b39 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_partial_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip as"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..6107c4c9929 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_prefix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pa"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..a1384c0f350 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_one_suffix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip ss"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..2c76773485e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pass"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/mod.rs new file mode 100644 index 00000000000..808935399e4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs new file mode 100644 index 00000000000..4d11d7e16b1 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_0/without_match_successful_test/skips_no_tests_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pattern"); + + "Outputs the successful test information" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/mod.rs new file mode 100644 index 00000000000..60167028c54 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/mod.rs @@ -0,0 +1,6 @@ +mod with_one_full_match_successful_test; +mod with_one_partial_match_successful_test; +mod with_one_prefix_match_successful_test; +mod with_one_suffix_match_successful_test; +mod with_two_partial_match_successful_tests; +mod without_match_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..6258006cf83 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_full_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip level_1::pass"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..7044b24e304 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_partial_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip 1::"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..0ba11fe1ac9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_prefix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip level_1"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs new file mode 100644 index 00000000000..e8271a45eeb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs new file mode 100644 index 00000000000..9d6cd25a770 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_one_suffix_match_successful_test/skips_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip ss"); + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly::level_1::pass"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..d1391847a98 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pass"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/mod.rs new file mode 100644 index 00000000000..808935399e4 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod skips_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs new file mode 100644 index 00000000000..91d2ad89a43 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/level_1/without_match_successful_test/skips_no_tests_feature.rs @@ -0,0 +1,44 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pattern"); + + "Outputs the successful test information" { + then_the_standard_output_should_have("test assembly::level_1::pass ... ok"); + } + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..434b6f59fb1 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_1/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--skip pattern"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..955602305b9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pass_1 --skip pass_2"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..12e6efd354d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip pass_1 --skip level_1"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..f9b684c9c8f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_2/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--skip pattern1 --skip pattern2"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..766268dda64 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_0/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip fail --skip pass_1 --skip pass_2"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/mod.rs new file mode 100644 index 00000000000..593a4002418 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/mod.rs @@ -0,0 +1 @@ +mod with_two_partial_match_successful_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..65ba9e942cf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod skips_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs new file mode 100644 index 00000000000..52f526c3e53 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/level_1/with_two_partial_match_successful_tests/skips_tests_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); + } + + #[wasm_bindgen_test] + fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "--skip fail --skip pass_1 --skip pass_2"); + + "Outputs no information about the skipped test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the skipped test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns Success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/mod.rs new file mode 100644 index 00000000000..331a0003e42 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/mod.rs @@ -0,0 +1,3 @@ +mod level_0; +mod level_1; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/mod.rs new file mode 100644 index 00000000000..2c8451c43e5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_tests_missing_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/warns_tests_missing_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/warns_tests_missing_feature.rs new file mode 100644 index 00000000000..9ae6cec25fc --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/count_3/without_tests/warns_tests_missing_feature.rs @@ -0,0 +1,19 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_and_the_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments("--skip pattern1 --skip pattern2 --skip pattern3"); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Returns true" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/mod.rs new file mode 100644 index 00000000000..4436fd24ae0 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/__skip_pattern/mod.rs @@ -0,0 +1,3 @@ +mod count_1; +mod count_2; +mod count_3; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/mod.rs new file mode 100644 index 00000000000..1f486f736cb --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/mod.rs @@ -0,0 +1,5 @@ +mod __include_ignored; +mod __list; +mod __skip_eq_pattern; +mod __skip_pattern; +mod testname; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/mod.rs new file mode 100644 index 00000000000..a91ed4f294f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/mod.rs @@ -0,0 +1,4 @@ +mod with_partial_test_match; +mod with_successful_test_match_1_of_2; +mod with_successful_test_match_2_of_2; +mod without_test_match; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/executes_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/executes_no_tests_feature.rs new file mode 100644 index 00000000000..cd5d2416549 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/executes_no_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pass --nocapture --exact"); + + "Outputs its running 0 tests" { + then_the_standard_output_should_have("running 0 tests"); + } + + "Outputs no information about the test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/mod.rs new file mode 100644 index 00000000000..a3d5d33fada --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_partial_test_match/mod.rs @@ -0,0 +1 @@ +mod executes_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/executes_only_one_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/executes_only_one_test_feature.rs new file mode 100644 index 00000000000..847190e13a7 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/executes_only_one_test_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pass_1 --nocapture --exact"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test 1 summary" { + then_the_standard_output_should_have("pass_1 ... ok"); + } + + "Outputs the successful test 1 standard output" { + then_the_standard_output_should_have("pass_1 standard output"); + } + + "Outputs no information about the test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/mod.rs new file mode 100644 index 00000000000..f10b6dd8657 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_1_of_2/mod.rs @@ -0,0 +1 @@ +mod executes_only_one_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/executes_only_one_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/executes_only_one_test_feature.rs new file mode 100644 index 00000000000..c1c1265e5c0 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/executes_only_one_test_feature.rs @@ -0,0 +1,56 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pass_2 --nocapture --exact"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test 2 summary" { + then_the_standard_output_should_have("pass_2 ... ok"); + } + + "Outputs the successful test 2 standard output" { + then_the_standard_output_should_have("pass_2 standard output"); + } + + "Outputs no information about the test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/mod.rs new file mode 100644 index 00000000000..f10b6dd8657 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/with_successful_test_match_2_of_2/mod.rs @@ -0,0 +1 @@ +mod executes_only_one_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/executes_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/executes_no_tests_feature.rs new file mode 100644 index 00000000000..f9218d62190 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/executes_no_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "boo --nocapture --exact"); + + "Outputs its running 0 tests" { + then_the_standard_output_should_have("running 0 tests"); + } + + "Outputs no information about the test 1" { + then_the_standard_output_should_not_have("pass_1"); + } + + "Outputs no information about the test 2" { + then_the_standard_output_should_not_have("pass_2"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 2 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/mod.rs new file mode 100644 index 00000000000..a3d5d33fada --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/__exact/without_test_match/mod.rs @@ -0,0 +1 @@ +mod executes_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/mod.rs new file mode 100644 index 00000000000..0e1da116ca2 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/__nocapture/mod.rs @@ -0,0 +1 @@ +mod __exact; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/mod.rs new file mode 100644 index 00000000000..60167028c54 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/mod.rs @@ -0,0 +1,6 @@ +mod with_one_full_match_successful_test; +mod with_one_partial_match_successful_test; +mod with_one_prefix_match_successful_test; +mod with_one_suffix_match_successful_test; +mod with_two_partial_match_successful_tests; +mod without_match_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..49528bfa977 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pass"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_full_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..444b316fc7d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "as"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_partial_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..9c108b5e48f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pa"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_prefix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..171fc083d24 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "ss"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_one_suffix_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/executes_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/executes_tests_feature.rs new file mode 100644 index 00000000000..b900d9ea82f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/executes_tests_feature.rs @@ -0,0 +1,51 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass_1() { + console_log!("pass_1 standard output"); + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn pass_2() { + console_log!("pass_2 standard output"); + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "pass"); + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the successful test 1 summary" { + then_the_standard_output_should_have("pass_1 ... ok"); + } + + "Outputs the successful test 2 summary" { + then_the_standard_output_should_have("pass_2 ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 2 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/mod.rs new file mode 100644 index 00000000000..a430fba8f7d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/with_two_partial_match_successful_tests/mod.rs @@ -0,0 +1 @@ +mod executes_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/executes_no_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/executes_no_tests_feature.rs new file mode 100644 index 00000000000..fcb4234bdbf --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/executes_no_tests_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +use crate::__steps__::standard_output::then_the_standard_output_should_not_have; +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_for_test_mode_and_the_arguments; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments(test_mode, "cool"); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs no information about the skipped test" { + then_the_standard_output_should_not_have("test assembly_with_one_successful_test::pass"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 0 ignored; 1 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/mod.rs new file mode 100644 index 00000000000..a3d5d33fada --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/default/without_match_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_no_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/mod.rs new file mode 100644 index 00000000000..8520fe25bbc --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/with_arguments/testname/mod.rs @@ -0,0 +1,2 @@ +mod __nocapture; +mod default; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/mod.rs new file mode 100644 index 00000000000..4ca47c84090 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/mod.rs @@ -0,0 +1,6 @@ +mod with_one_failing_test; +mod with_one_ignored_test; +mod with_one_ignored_with_reason_test; +mod with_one_successful_and_one_failing_tests; +mod with_one_successful_and_one_ignored_tests; +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/executes_test_feature.rs new file mode 100644 index 00000000000..b0412cbfdff --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/executes_test_feature.rs @@ -0,0 +1,43 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::error_code::then_failure_should_have_been_returned; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the failed test summary" { + then_the_standard_output_should_have("test assembly::fail ... FAIL"); + } + + "Outputs the failed test assertion error" { + then_the_standard_output_should_have("assertion `left == right` failed\n left: 1\n right: 2"); + } + + "Outputs the assembly failure summary" { + then_the_standard_output_should_have("failures:\n\n assembly::fail"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 filtered out"); + } + + "Returns failure" { + then_failure_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_failing_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/ignores_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/ignores_test_feature.rs new file mode 100644 index 00000000000..39fb1028353 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/ignores_test_feature.rs @@ -0,0 +1,42 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"# +); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the ignored test summary" { + then_the_standard_output_should_have("test assembly::ignored ... ignored"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 1 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/mod.rs new file mode 100644 index 00000000000..a30bf9b336b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_test/mod.rs @@ -0,0 +1 @@ +mod ignores_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/ignores_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/ignores_test_feature.rs new file mode 100644 index 00000000000..55281c2a8a6 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/ignores_test_feature.rs @@ -0,0 +1,41 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +#[ignore = "test"] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(mode); + + "Outputs its running 1 test" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the ignored test summary" { + then_the_standard_output_should_have("test assembly::ignored ... ignored, test"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 0 passed; 0 failed; 1 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/mod.rs new file mode 100644 index 00000000000..a30bf9b336b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_ignored_with_reason_test/mod.rs @@ -0,0 +1 @@ +mod ignores_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/executes_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/executes_tests_feature.rs new file mode 100644 index 00000000000..ea04dd8803a --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/executes_tests_feature.rs @@ -0,0 +1,52 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::error_code::then_failure_should_have_been_returned; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +fn fail() { + assert_eq!(1, 2); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the failed test summary" { + then_the_standard_output_should_have("test assembly::fail ... FAIL"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the failed test assertion error" { + then_the_standard_output_should_have("assertion `left == right` failed\n left: 1\n right: 2"); + } + + "Outputs the assembly failure summary" { + then_the_standard_output_should_have("failures:\n\n assembly::fail\n"); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 filtered out"); + } + + "Returns failure" { + then_failure_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/mod.rs new file mode 100644 index 00000000000..a430fba8f7d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_failing_tests/mod.rs @@ -0,0 +1 @@ +mod executes_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/executes_one_test_and_ignores_another_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/executes_one_test_and_ignores_another_feature.rs new file mode 100644 index 00000000000..17b8b8c6f99 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/executes_one_test_and_ignores_another_feature.rs @@ -0,0 +1,50 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} + +#[wasm_bindgen_test] +#[ignore] +fn ignored() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 2 tests" { + then_the_standard_output_should_have("running 2 tests"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs the ignored test summary" { + then_the_standard_output_should_have("test assembly::ignored ... ignored"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 1 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/mod.rs new file mode 100644 index 00000000000..ac2bfb61d14 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_and_one_ignored_tests/mod.rs @@ -0,0 +1 @@ +mod executes_one_test_and_ignores_another_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..fcb80b517ce --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/executes_test_feature.rs @@ -0,0 +1,40 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +#[wasm_bindgen_test] +fn pass() { + assert_eq!(1, 1); +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 1 tests" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_0/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/mod.rs new file mode 100644 index 00000000000..db99b0bac03 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/mod.rs @@ -0,0 +1 @@ +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..c6907199d5e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/executes_test_feature.rs @@ -0,0 +1,44 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } +} +"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 1 tests" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::level_1::pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_1/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/mod.rs new file mode 100644 index 00000000000..db99b0bac03 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/mod.rs @@ -0,0 +1 @@ +mod with_one_successful_test; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/executes_test_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/executes_test_feature.rs new file mode 100644 index 00000000000..b6e0508416c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/executes_test_feature.rs @@ -0,0 +1,45 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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_for_test_mode; +use crate::__steps__::Context; +use crate::__steps__::TestMode; +use auroka_morpheus_macros_feature::feature; + +feature! { + test_mode: TestMode + + given_there_is_an_assembly_with(r#" +mod level_1 { + mod level_2 { + use wasm_bindgen_test::*; + + #[wasm_bindgen_test] + fn pass() { + assert_eq!(1, 1); + } + } +}"#); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode(test_mode); + + "Outputs its running 1 tests" { + then_the_standard_output_should_have("running 1 test"); + } + + "Outputs the successful test summary" { + then_the_standard_output_should_have("test assembly::level_1::level_2::pass ... ok"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Outputs the assembly test summary" { + then_the_standard_output_should_have("test result: ok. 1 passed; 0 failed; 0 ignored; 0 filtered out"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/mod.rs new file mode 100644 index 00000000000..4fd4981528c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/level_2/with_one_successful_test/mod.rs @@ -0,0 +1 @@ +mod executes_test_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/mod.rs new file mode 100644 index 00000000000..a2590091967 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/mod.rs @@ -0,0 +1,4 @@ +mod level_0; +mod level_1; +mod level_2; +mod without_tests; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/mod.rs new file mode 100644 index 00000000000..829ab29e8ab --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/mod.rs @@ -0,0 +1 @@ +mod warns_no_tests_to_run_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/warns_no_tests_to_run_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/warns_no_tests_to_run_feature.rs new file mode 100644 index 00000000000..e0947fe77f5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/with_an_assembly/without_arguments/without_tests/warns_no_tests_to_run_feature.rs @@ -0,0 +1,24 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_without_anything; +use crate::__steps__::standard_error::then_the_standard_error_should_be_empty; +use crate::__steps__::standard_output::then_the_standard_output_should_have; +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; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_an_assembly_without_anything(); + when_wasm_bindgen_test_runner_is_invoked_with_the_assembly(); + + "Outputs no tests to run warning" { + then_the_standard_output_should_have("no tests to run!"); + } + + "Outputs no error" { + then_the_standard_error_should_be_empty(); + } + + "Returns an error code" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/handles_missing_arguments_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/handles_missing_arguments_feature.rs new file mode 100644 index 00000000000..3a1a37dfb68 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/handles_missing_arguments_feature.rs @@ -0,0 +1,17 @@ +use crate::__steps__::error_code::then_failure_should_have_been_returned; +use crate::__steps__::standard_error::then_the_standard_error_should_have; +use crate::__steps__::wasm_bindgen_test_runner::when_wasm_bindgen_test_runner_is_invoked_without_arguments; +use crate::__steps__::Context; +use auroka_morpheus_macros_feature::feature; + +feature! { + when_wasm_bindgen_test_runner_is_invoked_without_arguments(); + + "Outputs test file missing error" { + then_the_standard_error_should_have("Error: must have a file to test as first argument"); + } + + "Returns an error code" { + then_failure_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/mod.rs new file mode 100644 index 00000000000..c8d19e73a5d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invocation/without_arguments/mod.rs @@ -0,0 +1 @@ +mod handles_missing_arguments_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/executes_tests_feature.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/executes_tests_feature.rs new file mode 100644 index 00000000000..fa97884b270 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/executes_tests_feature.rs @@ -0,0 +1,28 @@ +use crate::__steps__::cargo_nextest::when_cargo_nextest_is_invoked_over_the_package; +use crate::__steps__::cargo_nextest::Context; +use crate::__steps__::package::given_there_is_a_package_with_100_successful_tests; +use crate::__steps__::standard_error::then_the_standard_error_should_have; +use crate::__steps__::standard_error::then_the_standard_error_should_not_have; +use crate::__steps__::success::then_success_should_have_been_returned; +use auroka_morpheus_macros_feature::feature; + +feature! { + given_there_is_a_package_with_100_successful_tests(); + when_cargo_nextest_is_invoked_over_the_package(); + + "Outputs its running 100 tests" { + then_the_standard_error_should_have("Starting 100 tests across 1 binary"); + } + + "Outputs the tests execution summary" { + then_the_standard_error_should_have("100 tests run: 100 passed, 0 skipped"); + } + + "Outputs no error" { + then_the_standard_error_should_not_have("error:"); + } + + "Returns success" { + then_success_should_have_been_returned(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/mod.rs new file mode 100644 index 00000000000..a430fba8f7d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/cargo_nextest/mod.rs @@ -0,0 +1 @@ +mod executes_tests_feature; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/mod.rs new file mode 100644 index 00000000000..d6876d34a4d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/invoked_by/mod.rs @@ -0,0 +1 @@ +mod cargo_nextest; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__features__/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__features__/mod.rs new file mode 100644 index 00000000000..702c2d11681 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__features__/mod.rs @@ -0,0 +1,2 @@ +mod invocation; +mod invoked_by; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/assembly_builder.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/assembly_builder.rs new file mode 100644 index 00000000000..995203f3ed0 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/assembly_builder.rs @@ -0,0 +1,149 @@ +use predicates::str; +use rand::Rng; +use regex::Regex; +use std::env; +use std::fs; +use std::path::PathBuf; +use std::process::Command; +use std::process::Output; + +fn build_dir() -> PathBuf { + target_dir() + .join("wasm32-unknown-unknown") + .join("debug") + .join("deps") +} + +fn target_dir() -> PathBuf { + let mut dir = env::current_exe().unwrap(); + dir.pop(); // current exe + if dir.ends_with("deps") { + dir.pop(); + } + dir.pop(); // debug and/or release + dir +} + +fn repo_root() -> PathBuf { + let mut dir = target_dir(); + dir.pop(); // target + dir +} + +pub struct AssemblyBuilder { + root: PathBuf, + name: String, +} + +impl AssemblyBuilder { + pub fn new(name: &'static str) -> AssemblyBuilder { + let mut rng = rand::thread_rng(); + + let root = target_dir() + .join("wasm-bindgen-test-runner-tests") + .join(format!("{}-{}", name, rng.gen_range(100000..999999))); + + drop(fs::remove_dir_all(&root)); + fs::create_dir_all(&root).unwrap(); + + AssemblyBuilder { + root, + name: name.to_string(), + } + } + + pub fn clean(&mut self) { + drop(fs::remove_dir_all(&self.root)); + } + + pub fn file(&mut self, name: &str, contents: &str) -> &mut Self { + let dst = self.root.join(name); + fs::create_dir_all(dst.parent().unwrap()).unwrap(); + fs::write(&dst, contents).unwrap(); + self + } + + pub fn build(&mut self) -> PathBuf { + if !self.root.join("Cargo.toml").is_file() { + self.file( + "Cargo.toml", + &format!( + "[package] +name = '{}' +authors = [] +version = '1.0.0' +edition = '2021' + +[dev-dependencies] +wasm-bindgen-test = {{ path = '{}/crates/test' }} + +[patch.crates-io] +wasm-bindgen = {{ path = '{}' }} + +[workspace] +", + self.name, + repo_root().display(), + repo_root().display(), + ), + ); + } + + remove_files_prefix(&build_dir(), &format!("{}-", self.name)); + + let output = Command::new("cargo") + .current_dir(&self.root) + .arg("test") + .arg("--target") + .arg("wasm32-unknown-unknown") + .arg("--no-run") + .env("CARGO_TARGET_DIR", target_dir()) + .output() + .expect("Failed to build test assembly"); + + let assembly = PathBuf::from(extract_assembly_from_output(output)); + + let destination = self.root.join(format!("{}.wasm", self.name)); + + fs::copy(&assembly, &destination).unwrap(); + + fs::remove_file(&assembly).unwrap(); + + destination + } +} + +fn extract_assembly_from_output(output: Output) -> String { + let error_str = std::str::from_utf8(&output.stderr).unwrap(); + let last = error_str.lines().last().unwrap(); + + if last.starts_with("error") { + panic!("Failed to generate assembly\n{}", error_str); + } + + let re = Regex::new(r"\((.*?)\)").unwrap(); + let captures = re + .captures(last) + .expect(&format!("Failed to generate assembly\n{}", error_str)); + + captures.get(1).unwrap().as_str().to_string() +} + +fn remove_files_prefix(dir: &PathBuf, prefix: &str) { + if let Ok(entries) = fs::read_dir(dir) { + for entry in entries { + let entry = entry.unwrap(); + let path = entry.path(); + if path.is_file() + && path + .file_name() + .unwrap() + .to_str() + .unwrap() + .starts_with(prefix) + { + fs::remove_file(&path).unwrap(); + } + } + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_with.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_with.rs new file mode 100644 index 00000000000..a169f639373 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_with.rs @@ -0,0 +1,27 @@ +use crate::__steps__::assembly::AssemblyBuilder; +use crate::__steps__::package::prepare_tests; +use crate::__steps__::wasm_bindgen_test_runner::Sandbox; +use crate::__steps__::Context; +use lazy_static::lazy_static; +use std::collections::HashMap; +use std::path::PathBuf; +use std::sync::Mutex; + +lazy_static! { + static ref ASSEMBLY_CACHE: Mutex> = Mutex::new(HashMap::new()); +} + +pub fn given_there_is_an_assembly_with(context: &mut Context, content: &str) { + let mut cache = ASSEMBLY_CACHE.lock().unwrap(); + + let assembly_path = cache + .entry(content.to_string()) + .or_insert_with(|| { + AssemblyBuilder::new("assembly") + .file("src/lib.rs", &prepare_tests(content)) + .build() + }) + .clone(); + + context.sandbox_set(Sandbox::new(assembly_path)); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_without_anything.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_without_anything.rs new file mode 100644 index 00000000000..cf6bf55888d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/given_there_is_an_assembly_without_anything.rs @@ -0,0 +1,6 @@ +use crate::__steps__::assembly::given_there_is_an_assembly_with; +use crate::__steps__::Context; + +pub fn given_there_is_an_assembly_without_anything(context: &mut Context) { + given_there_is_an_assembly_with(context, ""); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/mod.rs new file mode 100644 index 00000000000..80b3b2ce558 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/assembly/mod.rs @@ -0,0 +1,7 @@ +mod assembly_builder; +mod given_there_is_an_assembly_with; +mod given_there_is_an_assembly_without_anything; + +pub use assembly_builder::*; +pub use given_there_is_an_assembly_with::*; +pub use given_there_is_an_assembly_without_anything::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/cargo_nextest_command.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/cargo_nextest_command.rs new file mode 100644 index 00000000000..73845ac34fe --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/cargo_nextest_command.rs @@ -0,0 +1,11 @@ +use super::super::wasm_bindgen_test_runner::wasm_bindgen_test_runner_env_set; +use super::super::TestMode; +use std::process::Command; + +pub fn cargo_nextest_command(mode: TestMode) -> Command { + let mut command = Command::new("cargo"); + + command.args(&["nextest", "run"]); + + return wasm_bindgen_test_runner_env_set(mode, command); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/context.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/context.rs new file mode 100644 index 00000000000..8224a97c01a --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/context.rs @@ -0,0 +1,46 @@ +use crate::__steps__::package::PackageBuilder; +use crate::__steps__::OutputContext; +use std::path::PathBuf; +use std::process::Output; + +pub struct Context { + output: Option>, + package_builder: Option, + path: Option, +} + +impl Context { + pub fn new() -> Self { + Context { + output: None, + package_builder: None, + path: None, + } + } + + pub fn output(&self) -> Result { + Ok(self.output.as_ref().unwrap().as_ref()?.clone()) + } + + pub fn output_set(&mut self, output: Result) { + self.output = Some(output); + } + + pub fn package_builder_set(&mut self, package_builder: PackageBuilder) { + self.package_builder = Some(package_builder); + } + + pub fn path(&self) -> &PathBuf { + self.path.as_ref().unwrap() + } + + pub fn path_set(&mut self, path: PathBuf) { + self.path = Some(path); + } +} + +impl OutputContext for Context { + fn output(&self) -> Result { + Ok(self.output.as_ref().unwrap().as_ref()?.clone()) + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/mod.rs new file mode 100644 index 00000000000..d77a461ba1c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/mod.rs @@ -0,0 +1,7 @@ +mod cargo_nextest_command; +mod context; +mod when_cargo_nextest_is_invoked_over_the_package; + +pub use cargo_nextest_command::*; +pub use context::*; +pub use when_cargo_nextest_is_invoked_over_the_package::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/when_cargo_nextest_is_invoked_over_the_package.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/when_cargo_nextest_is_invoked_over_the_package.rs new file mode 100644 index 00000000000..e13e73d5292 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/cargo_nextest/when_cargo_nextest_is_invoked_over_the_package.rs @@ -0,0 +1,11 @@ +use super::Context; +use crate::__steps__::cargo_nextest::cargo_nextest_command; +use crate::__steps__::TestMode; + +pub fn when_cargo_nextest_is_invoked_over_the_package(context: &mut Context) { + let mut command = cargo_nextest_command(TestMode::Default); + + command.current_dir(context.path()); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/context.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/context.rs new file mode 100644 index 00000000000..ffcd2a5e290 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/context.rs @@ -0,0 +1,43 @@ +use super::wasm_bindgen_test_runner::Sandbox; +use crate::__steps__::OutputContext; +use std::process::Output; + +pub struct Context { + output: Option>, + sandbox: Option, +} + +impl Context { + pub fn new() -> Self { + Context { + output: None, + sandbox: None, + } + } + + pub fn output(&self) -> Result { + Ok(self.output.as_ref().unwrap().as_ref()?.clone()) + } + + pub fn output_set(&mut self, output: Result) { + self.output = Some(output); + } + + pub fn sandbox(&self) -> &Sandbox { + self.sandbox.as_ref().unwrap() + } + + pub fn sandbox_mut(&mut self) -> &mut Sandbox { + self.sandbox.as_mut().unwrap() + } + + pub fn sandbox_set(&mut self, sandbox: Sandbox) { + self.sandbox = Some(sandbox); + } +} + +impl OutputContext for Context { + fn output(&self) -> Result { + Ok(self.output.as_ref().unwrap().as_ref()?.clone()) + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/mod.rs new file mode 100644 index 00000000000..f1df5dc51ad --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/mod.rs @@ -0,0 +1,3 @@ +mod then_failure_should_have_been_returned; + +pub use then_failure_should_have_been_returned::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/then_failure_should_have_been_returned.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/then_failure_should_have_been_returned.rs new file mode 100644 index 00000000000..c8a66cf273c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/error_code/then_failure_should_have_been_returned.rs @@ -0,0 +1,8 @@ +use crate::__steps__::Context; +use assert_cmd::prelude::*; + +pub fn then_failure_should_have_been_returned(context: &Context) { + let output = context.output().expect("No output was produced"); + + output.assert().failure(); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/mod.rs new file mode 100644 index 00000000000..84d466a0187 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/mod.rs @@ -0,0 +1,15 @@ +pub mod assembly; +pub mod cargo_nextest; +mod context; +pub mod error_code; +mod output_context; +pub mod package; +pub mod standard_error; +pub mod standard_output; +pub mod success; +mod test_mode; +pub mod wasm_bindgen_test_runner; + +pub use context::*; +pub use output_context::*; +pub use test_mode::TestMode; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/output_context.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/output_context.rs new file mode 100644 index 00000000000..e08010e9505 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/output_context.rs @@ -0,0 +1,5 @@ +use std::process::Output; + +pub trait OutputContext { + fn output(&self) -> Result; +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with.rs new file mode 100644 index 00000000000..5b866d34909 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with.rs @@ -0,0 +1,14 @@ +use super::{prepare_tests, PackageBuilder}; +use crate::__steps__::cargo_nextest::Context; + +pub fn given_there_is_a_package_with(context: &mut Context, content: &str) { + let mut builder = PackageBuilder::new("package"); + + let path = builder + .file("src/lib.rs", &prepare_tests(content)) + .finalize(); + + context.package_builder_set(builder); + + context.path_set(path); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with_100_successful_tests.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with_100_successful_tests.rs new file mode 100644 index 00000000000..389ae1f5691 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/given_there_is_a_package_with_100_successful_tests.rs @@ -0,0 +1,19 @@ +use crate::__steps__::cargo_nextest::Context; +use crate::__steps__::package::given_there_is_a_package_with; + +pub fn given_there_is_a_package_with_100_successful_tests(context: &mut Context) { + let mut tests = String::new(); + for i in 0..100 { + tests.push_str(&format!( + r#" +#[wasm_bindgen_test] +fn pass_{}() {{ + assert_eq!(1, 1); +}} +"#, + i + )); + } + + given_there_is_a_package_with(context, &tests); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/mod.rs new file mode 100644 index 00000000000..c240ef7418e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/mod.rs @@ -0,0 +1,9 @@ +mod given_there_is_a_package_with; +mod given_there_is_a_package_with_100_successful_tests; +mod package_builder; +mod prepare_tests; + +pub use given_there_is_a_package_with::*; +pub use given_there_is_a_package_with_100_successful_tests::*; +pub use package_builder::*; +pub use prepare_tests::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/package_builder.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/package_builder.rs new file mode 100644 index 00000000000..50ff3cdf658 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/package_builder.rs @@ -0,0 +1,129 @@ +use predicates::str; +use rand::Rng; +use std::env; +use std::fs; +use std::path::PathBuf; + +fn build_dir() -> PathBuf { + target_dir() + .join("wasm32-unknown-unknown") + .join("debug") + .join("deps") +} + +fn target_dir() -> PathBuf { + let mut dir = env::current_exe().unwrap(); + dir.pop(); // current exe + if dir.ends_with("deps") { + dir.pop(); + } + dir.pop(); // debug and/or release + dir +} + +fn repo_root() -> PathBuf { + let mut dir = target_dir(); + dir.pop(); // target + dir +} + +pub struct PackageBuilder { + root: PathBuf, + name: String, +} + +impl PackageBuilder { + pub fn new(name: &'static str) -> Self { + let mut rng = rand::thread_rng(); + + let root = target_dir() + .join("wasm-bindgen-test-runner-tests") + .join(format!("{}-{}", name, rng.gen_range(100000..999999))); + + drop(fs::remove_dir_all(&root)); + fs::create_dir_all(&root).unwrap(); + + Self { + root, + name: name.to_string(), + } + } + + pub fn check_cargo(&mut self) { + if !self.root.join("Cargo.toml").is_file() { + self.file( + "Cargo.toml", + &format!( + "[package] +name = '{}' +authors = [] +version = '1.0.0' +edition = '2021' + +[dev-dependencies] +wasm-bindgen-test = {{ path = '{}/crates/test' }} + +[patch.crates-io] +wasm-bindgen = {{ path = '{}' }} + +[workspace] +", + self.name, + repo_root().display(), + repo_root().display(), + ), + ); + } + } + + pub fn check_cargo_config(&mut self) { + if !self.root.join(".cargo/config.toml").is_file() { + // gets the current test executable + let runner = env::current_exe().unwrap(); + // drops the executable name + let runner = runner.parent().unwrap(); + // drops deps directory + let runner = runner.parent().unwrap(); + let runner = runner + .join("wasm-bindgen-test-runner") + .display() + .to_string(); + self.file( + ".cargo/config.toml", + format!( + r#"[build] +target = "wasm32-unknown-unknown" + +[target.wasm32-unknown-unknown] +runner = '{}' +"#, + runner + ) + .as_str(), + ); + } + } + + pub fn clean(&mut self) { + drop(fs::remove_dir_all(&self.root)); + } + + pub fn file(&mut self, name: &str, contents: &str) -> &mut Self { + let dst = self.root.join(name); + fs::create_dir_all(dst.parent().unwrap()).unwrap(); + fs::write(&dst, contents).unwrap(); + self + } + + pub fn finalize(&mut self) -> PathBuf { + self.check_cargo(); + self.check_cargo_config(); + self.root.clone() + } +} + +impl Drop for PackageBuilder { + fn drop(&mut self) { + self.clean(); + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/prepare_tests.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/prepare_tests.rs new file mode 100644 index 00000000000..e4abc680aa8 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/package/prepare_tests.rs @@ -0,0 +1,18 @@ +pub fn prepare_tests(tests: &str) -> String { + let mut final_content = String::from( + r#" +#[cfg(test)] +use wasm_bindgen_test::*; +"#, + ); + + for line in tests.lines() { + if line.starts_with("#[wasm_bindgen_test]") || line.starts_with("mod") { + final_content.push_str("#[cfg(test)]\n"); + } + final_content.push_str(line); + final_content.push_str("\n"); + } + + final_content +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/mod.rs new file mode 100644 index 00000000000..0f467bbfb08 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/mod.rs @@ -0,0 +1,7 @@ +mod then_the_standard_error_should_be_empty; +mod then_the_standard_error_should_have; +mod then_the_standard_error_should_not_have; + +pub use then_the_standard_error_should_be_empty::*; +pub use then_the_standard_error_should_have::*; +pub use then_the_standard_error_should_not_have::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_be_empty.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_be_empty.rs new file mode 100644 index 00000000000..349076fca7c --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_be_empty.rs @@ -0,0 +1,9 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::str; + +pub fn then_the_standard_error_should_be_empty(context: &dyn OutputContext) { + let output = context.output().expect("No output was produced"); + + output.assert().stderr(str::is_empty()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_have.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_have.rs new file mode 100644 index 00000000000..7e0b8a20935 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_have.rs @@ -0,0 +1,9 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::str; + +pub fn then_the_standard_error_should_have(context: &dyn OutputContext, content: &str) { + let output = context.output().expect("No output was produced"); + + output.assert().stderr(str::contains(content)); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_not_have.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_not_have.rs new file mode 100644 index 00000000000..4b697c9e546 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_error/then_the_standard_error_should_not_have.rs @@ -0,0 +1,10 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::boolean::PredicateBooleanExt; +use predicates::str; + +pub fn then_the_standard_error_should_not_have(context: &dyn OutputContext, content: &str) { + let output = context.output().expect("No output was produced"); + + output.assert().stderr(str::contains(content).not()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/mod.rs new file mode 100644 index 00000000000..e26bc7df85e --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/mod.rs @@ -0,0 +1,7 @@ +mod then_the_standard_output_should_be_empty; +mod then_the_standard_output_should_have; +mod then_the_standard_output_should_not_have; + +pub use then_the_standard_output_should_be_empty::*; +pub use then_the_standard_output_should_have::*; +pub use then_the_standard_output_should_not_have::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_be_empty.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_be_empty.rs new file mode 100644 index 00000000000..53fb3411ee5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_be_empty.rs @@ -0,0 +1,9 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::str; + +pub fn then_the_standard_output_should_be_empty(context: &dyn OutputContext) { + let output = context.output().expect("No output was produced"); + + output.assert().stdout(str::is_empty()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_have.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_have.rs new file mode 100644 index 00000000000..86f29f1339b --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_have.rs @@ -0,0 +1,9 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::str; + +pub fn then_the_standard_output_should_have(context: &dyn OutputContext, content: &str) { + let output = context.output().expect("No output was produced"); + + output.assert().stdout(str::contains(content)); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_not_have.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_not_have.rs new file mode 100644 index 00000000000..bc2aae0c0c8 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/standard_output/then_the_standard_output_should_not_have.rs @@ -0,0 +1,10 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; +use predicates::boolean::PredicateBooleanExt; +use predicates::str; + +pub fn then_the_standard_output_should_not_have(context: &dyn OutputContext, content: &str) { + let output = context.output().expect("No output was produced"); + + output.assert().stdout(str::contains(content).not()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/mod.rs new file mode 100644 index 00000000000..a0461886d72 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/mod.rs @@ -0,0 +1,3 @@ +mod then_success_should_have_been_returned; + +pub use then_success_should_have_been_returned::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/then_success_should_have_been_returned.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/then_success_should_have_been_returned.rs new file mode 100644 index 00000000000..d0885f3abda --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/success/then_success_should_have_been_returned.rs @@ -0,0 +1,8 @@ +use crate::__steps__::OutputContext; +use assert_cmd::prelude::*; + +pub fn then_success_should_have_been_returned(context: &dyn OutputContext) { + let output = context.output().expect("No output was produced"); + + output.assert().success(); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/test_mode.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/test_mode.rs new file mode 100644 index 00000000000..751be7b3423 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/test_mode.rs @@ -0,0 +1,25 @@ +pub enum TestMode { + Default, + Deno, + Node, + BrowserDefault, + BrowserChrome, + BrowserEdge, + BrowserFirefox, + BrowserSafari, + DedicatedWorkerDefault, + DedicatedWorkerChrome, + DedicatedWorkerEdge, + DedicatedWorkerFirefox, + DedicatedWorkerSafari, + ServiceWorkerDefault, + ServiceWorkerChrome, + ServiceWorkerEdge, + ServiceWorkerFirefox, + ServiceWorkerSafari, + SharedWorkerDefault, + SharedWorkerChrome, + SharedWorkerEdge, + SharedWorkerFirefox, + SharedWorkerSafari, +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/mod.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/mod.rs new file mode 100644 index 00000000000..6d5d00f51a9 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/mod.rs @@ -0,0 +1,19 @@ +mod sandbox; +mod wasm_bindgen_test_runner_command; +mod wasm_bindgen_test_runner_env_set; +mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly; +mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments; +mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode; +mod when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_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 sandbox::*; +pub use wasm_bindgen_test_runner_command::*; +pub use wasm_bindgen_test_runner_env_set::*; +pub use when_wasm_bindgen_test_runner_is_invoked_with_the_assembly::*; +pub use when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments::*; +pub use when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode::*; +pub use when_wasm_bindgen_test_runner_is_invoked_with_the_option::*; +pub use when_wasm_bindgen_test_runner_is_invoked_without_arguments::*; +pub use when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments::*; diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/sandbox.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/sandbox.rs new file mode 100644 index 00000000000..94e3151559d --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/sandbox.rs @@ -0,0 +1,70 @@ +use rand::Rng; +use std::fs; +use std::path::PathBuf; + +pub struct Sandbox { + assembly: Option, + original: PathBuf, + root: Option, +} + +impl Sandbox { + pub fn new(original: PathBuf) -> Self { + if !&original.exists() { + panic!("Couldn't find generated assembly: {}", &original.display()); + } + Self { + assembly: None, + original, + root: None, + } + } + + fn init(&mut self) { + let file_name = self.original.file_name().and_then(|s| s.to_str()).unwrap(); + + let mut rng = rand::thread_rng(); + + let root = self + .original + .parent() // chop off file name + .map(|p| p.join(format!("sandbox-{}", rng.gen_range(100000..999999)))) + .unwrap(); + + drop(fs::remove_dir_all(&root)); + + let target = root.join("debug").join("deps"); + + fs::create_dir_all(&target).unwrap(); + + let assembly = target.join(file_name); + + fs::copy(&self.original, &assembly).unwrap(); + + self.assembly = Some(assembly); + self.root = Some(root); + } + + pub fn assembly(&mut self) -> &PathBuf { + if self.assembly.is_none() { + self.init(); + } + self.assembly.as_ref().unwrap() + } + + pub fn original(&self) -> &PathBuf { + &self.original + } + + pub fn root(&self) -> &PathBuf { + self.root.as_ref().unwrap() + } +} + +impl Drop for Sandbox { + fn drop(&mut self) { + if let Some(root) = &self.root { + drop(fs::remove_dir_all(root)); + } + } +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_command.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_command.rs new file mode 100644 index 00000000000..0fa62788382 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_command.rs @@ -0,0 +1,10 @@ +use super::super::TestMode; +use super::wasm_bindgen_test_runner_env_set; +use assert_cmd::cargo::CommandCargoExt; +use std::process::Command; + +pub fn wasm_bindgen_test_runner_command(mode: TestMode) -> Command { + let command = Command::cargo_bin("wasm-bindgen-test-runner").unwrap(); + + return wasm_bindgen_test_runner_env_set(mode, command); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_env_set.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_env_set.rs new file mode 100644 index 00000000000..b2b5293754f --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/wasm_bindgen_test_runner_env_set.rs @@ -0,0 +1,40 @@ +use super::super::TestMode; +use std::process::Command; + +pub fn wasm_bindgen_test_runner_env_set(mode: TestMode, mut command: Command) -> Command { + match mode { + TestMode::Default => &mut command, + TestMode::Deno => command.env("WASM_BINDGEN_USE_DENO", "true"), + TestMode::Node => command.env("WASM_BINDGEN_TEST_ONLY_NODE", "true"), + TestMode::BrowserDefault => command.env("WASM_BINDGEN_USE_BROWSER", "true"), + TestMode::BrowserChrome => command.env("WASM_BINDGEN_USE_BROWSER", "chrome"), + TestMode::BrowserEdge => command.env("WASM_BINDGEN_USE_BROWSER", "edge"), + TestMode::BrowserFirefox => command.env("WASM_BINDGEN_USE_BROWSER", "firefox"), + TestMode::BrowserSafari => command.env("WASM_BINDGEN_USE_BROWSER", "safari"), + TestMode::DedicatedWorkerDefault => { + command.env("WASM_BINDGEN_USE_DEDICATED_WORKER", "true") + } + TestMode::DedicatedWorkerChrome => { + command.env("WASM_BINDGEN_USE_DEDICATED_WORKER", "chrome") + } + TestMode::DedicatedWorkerEdge => command.env("WASM_BINDGEN_USE_DEDICATED_WORKER", "edge"), + TestMode::DedicatedWorkerFirefox => { + command.env("WASM_BINDGEN_USE_DEDICATED_WORKER", "firefox") + } + TestMode::DedicatedWorkerSafari => { + command.env("WASM_BINDGEN_USE_DEDICATED_WORKER", "safari") + } + TestMode::ServiceWorkerDefault => command.env("WASM_BINDGEN_USE_SERVICE_WORKER", "true"), + TestMode::ServiceWorkerChrome => command.env("WASM_BINDGEN_USE_SERVICE_WORKER", "chrome"), + TestMode::ServiceWorkerEdge => command.env("WASM_BINDGEN_USE_SERVICE_WORKER", "edge"), + TestMode::ServiceWorkerFirefox => command.env("WASM_BINDGEN_USE_SERVICE_WORKER", "firefox"), + TestMode::ServiceWorkerSafari => command.env("WASM_BINDGEN_USE_SERVICE_WORKER", "safari"), + TestMode::SharedWorkerDefault => command.env("WASM_BINDGEN_USE_SHARED_WORKER", "true"), + TestMode::SharedWorkerChrome => command.env("WASM_BINDGEN_USE_SHARED_WORKER", "chrome"), + TestMode::SharedWorkerEdge => command.env("WASM_BINDGEN_USE_SHARED_WORKER", "edge"), + TestMode::SharedWorkerFirefox => command.env("WASM_BINDGEN_USE_SHARED_WORKER", "firefox"), + TestMode::SharedWorkerSafari => command.env("WASM_BINDGEN_USE_SHARED_WORKER", "safari"), + }; + + command +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly.rs new file mode 100644 index 00000000000..42651932189 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly.rs @@ -0,0 +1,11 @@ +use crate::__steps__::{ + wasm_bindgen_test_runner::wasm_bindgen_test_runner_command, Context, TestMode, +}; + +pub fn when_wasm_bindgen_test_runner_is_invoked_with_the_assembly(context: &mut Context) { + let mut command = wasm_bindgen_test_runner_command(TestMode::Default); + + command.arg(context.sandbox_mut().assembly()); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments.rs new file mode 100644 index 00000000000..d7b7d7d4bca --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments.rs @@ -0,0 +1,20 @@ +use crate::__steps__::{ + wasm_bindgen_test_runner::wasm_bindgen_test_runner_command, Context, TestMode, +}; + +pub fn when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_and_the_arguments( + context: &mut Context, + arguments: &str, +) { + let mut command = wasm_bindgen_test_runner_command(TestMode::Default); + + if arguments.starts_with("--list") && arguments.contains("--ignored") { + command.arg(context.sandbox().original()); + } else { + command.arg(context.sandbox_mut().assembly()); + } + + command.args(arguments.split_whitespace()); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode.rs new file mode 100644 index 00000000000..6ae732b35f1 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode.rs @@ -0,0 +1,13 @@ +use crate::__steps__::TestMode; +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_for_test_mode( + context: &mut Context, + mode: TestMode, +) { + let mut command = wasm_bindgen_test_runner_command(mode); + + command.arg(context.sandbox_mut().assembly()); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments.rs new file mode 100644 index 00000000000..6d7636026b5 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_assembly_for_test_mode_and_the_arguments.rs @@ -0,0 +1,20 @@ +use crate::__steps__::TestMode; +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_for_test_mode_and_the_arguments( + context: &mut Context, + mode: TestMode, + arguments: &str, +) { + let mut command = wasm_bindgen_test_runner_command(mode); + + if arguments.starts_with("--list") && arguments.contains("--ignored") { + command.arg(context.sandbox().original()); + } else { + command.arg(context.sandbox_mut().assembly()); + } + + command.args(arguments.split_whitespace()); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_option.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_option.rs new file mode 100644 index 00000000000..fe125708a75 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_with_the_option.rs @@ -0,0 +1,14 @@ +use crate::__steps__::{ + wasm_bindgen_test_runner::wasm_bindgen_test_runner_command, Context, TestMode, +}; + +pub fn when_wasm_bindgen_test_runner_is_invoked_with_the_option( + context: &mut Context, + argument: &str, +) { + let mut command = wasm_bindgen_test_runner_command(TestMode::Default); + + command.arg(argument); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_without_arguments.rs b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_without_arguments.rs new file mode 100644 index 00000000000..141651f3453 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/__steps__/wasm_bindgen_test_runner/when_wasm_bindgen_test_runner_is_invoked_without_arguments.rs @@ -0,0 +1,9 @@ +use crate::__steps__::{ + wasm_bindgen_test_runner::wasm_bindgen_test_runner_command, Context, TestMode, +}; + +pub fn when_wasm_bindgen_test_runner_is_invoked_without_arguments(context: &mut Context) { + let mut command = wasm_bindgen_test_runner_command(TestMode::Default); + + context.output_set(command.output()); +} diff --git a/crates/cli/tests/wasm_bindgen_test_runner/main.rs b/crates/cli/tests/wasm_bindgen_test_runner/main.rs new file mode 100644 index 00000000000..4adc5c045a1 --- /dev/null +++ b/crates/cli/tests/wasm_bindgen_test_runner/main.rs @@ -0,0 +1,3 @@ +#![cfg(not(target_arch = "wasm32"))] +mod __features__; +mod __steps__; diff --git a/crates/test-macro/src/lib.rs b/crates/test-macro/src/lib.rs index c3829df823c..0c983d0f848 100644 --- a/crates/test-macro/src/lib.rs +++ b/crates/test-macro/src/lib.rs @@ -80,6 +80,11 @@ pub fn wasm_bindgen_test( None => quote! { ::core::option::Option::None }, }; + let ignore_str = match ignore.clone() { + Some(_) => "$", + None => "", + }; + let ignore = match ignore { Some(Some(lit)) => { quote! { ::core::option::Option::Some(::core::option::Option::Some(#lit)) } @@ -94,14 +99,13 @@ pub fn wasm_bindgen_test( quote! { cx.execute_sync(test_name, #ident, #should_panic, #ignore); } }; - // We generate a `#[no_mangle]` with a known prefix so the test harness can - // later slurp up all of these functions and pass them as arguments to the - // main test harness. This is the entry point for all tests. let name = format_ident!("__wbgt_{}_{}", ident, CNT.fetch_add(1, Ordering::SeqCst)); let wasm_bindgen_path = attributes.wasm_bindgen_path; + let ident_str = ident.to_string(); + let name_str = name.to_string(); tokens.extend( quote! { - #[no_mangle] + #[export_name = concat!(#name_str, "$", module_path!(), "::", #ident_str, #ignore_str)] pub extern "C" fn #name(cx: &#wasm_bindgen_path::__rt::Context) { let test_name = ::core::concat!(::core::module_path!(), "::", ::core::stringify!(#ident)); #test_body diff --git a/crates/test/src/rt/detect.rs b/crates/test/src/rt/detect.rs index 235b14c67d6..f4cdd988d59 100644 --- a/crates/test/src/rt/detect.rs +++ b/crates/test/src/rt/detect.rs @@ -12,6 +12,11 @@ extern "C" { #[wasm_bindgen(method, getter, structural)] fn constructor(me: &Scope) -> Constructor; + #[wasm_bindgen(method, getter, structural, js_name = Deno)] + fn deno(me: &Scope) -> Option; + + type Deno; + type Constructor; #[wasm_bindgen(method, getter, structural)] fn name(me: &Constructor) -> String; @@ -27,7 +32,10 @@ pub fn detect() -> Runtime { "DedicatedWorkerGlobalScope" | "SharedWorkerGlobalScope" | "ServiceWorkerGlobalScope" => Runtime::Worker, - _ => Runtime::Browser, + _ => match scope.deno() { + Some(_) => Runtime::Node, + _ => Runtime::Browser, + }, }, None => Runtime::Node, } diff --git a/crates/test/src/rt/mod.rs b/crates/test/src/rt/mod.rs index c1be2904303..08939db04f3 100644 --- a/crates/test/src/rt/mod.rs +++ b/crates/test/src/rt/mod.rs @@ -121,6 +121,9 @@ pub struct Context { } struct State { + /// Restricts the filter to be strict, that is only allow exact match + exact: Cell, + /// An optional filter used to restrict which tests are actually executed /// and which are ignored. This is passed via the `args` function which /// comes from the command line of `wasm-bindgen-test-runner`. Currently @@ -130,6 +133,9 @@ struct State { /// Include ignored tests. include_ignored: Cell, + /// Disabled the test output capture + nocapture: Cell, + /// Tests to skip. skip: RefCell>, @@ -159,6 +165,9 @@ struct State { /// How to actually format output, either node.js or browser-specific /// implementation. formatter: Box, + + /// Total tests + tests: Cell, } /// Failure reasons. @@ -281,8 +290,10 @@ impl Context { Context { state: Rc::new(State { + exact: Default::default(), filter: Default::default(), include_ignored: Default::default(), + nocapture: Default::default(), skip: Default::default(), failures: Default::default(), filtered: Default::default(), @@ -291,6 +302,7 @@ impl Context { running: Default::default(), succeeded: Default::default(), formatter, + tests: Default::default(), }), } } @@ -316,6 +328,10 @@ impl Context { ); } else if let Some(arg) = arg.strip_prefix("--skip=") { skip.push(arg.to_owned()) + } else if arg == "--nocapture" { + self.state.nocapture.set(true); + } else if arg == "--exact" { + self.state.exact.set(true); } else if arg.starts_with('-') { panic!("flag {} not supported", arg); } else if filter.is_some() { @@ -336,11 +352,11 @@ impl Context { /// The promise returned resolves to either `true` if all tests passed or /// `false` if at least one test failed. pub fn run(&self, tests: Vec) -> Promise { - let noun = if tests.len() == 1 { "test" } else { "tests" }; - self.state - .formatter - .writeln(&format!("running {} {}", tests.len(), noun)); - self.state.formatter.writeln(""); + if !self.state.exact.get() { + self.state.print_running_tests(tests.len()); + } else { + self.state.tests.set(tests.len()); + } // Execute all our test functions through their wasm shims (unclear how // to pass native function pointers around here). Each test will @@ -483,6 +499,22 @@ impl Context { ) } + fn filter(&self, name: &str) -> bool { + let filter = self.state.filter.borrow(); + let exact = self.state.exact.get(); + + if let Some(filter) = &*filter { + if exact { + let test_name = &name[name.find("::").unwrap() + 2..]; + test_name != filter + } else { + !name.contains(filter) + } + } else { + false + } + } + fn execute( &self, name: &str, @@ -492,13 +524,10 @@ impl Context { ) { // If our test is filtered out, record that it was filtered and move // on, nothing to do here. - let filter = self.state.filter.borrow(); - if let Some(filter) = &*filter { - if !name.contains(filter) { - let filtered = self.state.filtered.get(); - self.state.filtered.set(filtered + 1); - return; - } + if self.filter(name) { + let filtered = self.state.filtered.get(); + self.state.filtered.set(filtered + 1); + return; } for skip in &*self.state.skip.borrow() { @@ -520,6 +549,10 @@ impl Context { } } + if self.state.exact.get() { + self.state.print_running_tests(1); + } + // Looks like we've got a test that needs to be executed! Push it onto // the list of remaining tests. let output = Output { @@ -589,6 +622,10 @@ impl Future for ExecuteTests { // so we shouldn't have any more remaining tests either. assert_eq!(remaining.len(), 0); + if self.0.exact.get() && self.0.tests.get() == self.0.filtered.get() { + self.0.print_running_tests(0); + } + self.0.print_results(); let all_passed = self.0.failures.borrow().len() == 0; Poll::Ready(all_passed) @@ -632,6 +669,13 @@ impl State { } } + fn print_running_tests(&self, count: usize) { + let noun = if count == 1 { "test" } else { "tests" }; + self.formatter + .writeln(&format!("running {} {}", count, noun)); + self.formatter.writeln(""); + } + fn print_results(&self) { let failures = self.failures.borrow(); if failures.len() > 0 { @@ -665,7 +709,7 @@ impl State { } logs.push_str(which); logs.push_str(" output:\n"); - logs.push_str(&tab(output)); + logs.push_str(output); logs.push('\n'); } @@ -703,7 +747,7 @@ impl State { logs.push_str(&tab(&error_string)); } - let msg = format!("---- {} output ----\n{}", test.name, tab(&logs)); + let msg = format!("---- {} output ----\n{}", test.name, &logs); self.formatter.writeln(&msg); } }