diff options
| author | Yusuke Tanaka <yusuktan@maguro.dev> | 2021-02-02 00:55:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-01 10:55:23 -0500 |
| commit | 84f8b87f1b0fc6b7ec3a7f157f99d7f098d43101 (patch) | |
| tree | 37ad25f567cbce1cb4f1e6b1f33360233de8fe78 /runtime/js.rs | |
| parent | 23281be33a378ca548f0a407f642331f20b00a43 (diff) | |
chore: make all tests annotated with `#[cfg(test)]` (#9347)
Diffstat (limited to 'runtime/js.rs')
| -rw-r--r-- | runtime/js.rs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/runtime/js.rs b/runtime/js.rs index ebccaeba6..d61572b21 100644 --- a/runtime/js.rs +++ b/runtime/js.rs @@ -11,21 +11,26 @@ pub fn deno_isolate_init() -> Snapshot { Snapshot::Static(data) } -#[test] -fn cli_snapshot() { - let mut js_runtime = deno_core::JsRuntime::new(deno_core::RuntimeOptions { - startup_snapshot: Some(deno_isolate_init()), - ..Default::default() - }); - js_runtime - .execute( - "<anon>", - r#" +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cli_snapshot() { + let mut js_runtime = deno_core::JsRuntime::new(deno_core::RuntimeOptions { + startup_snapshot: Some(deno_isolate_init()), + ..Default::default() + }); + js_runtime + .execute( + "<anon>", + r#" if (!(bootstrap.mainRuntime && bootstrap.workerRuntime)) { throw Error("bad"); } console.log("we have console.log!!!"); "#, - ) - .unwrap(); + ) + .unwrap(); + } } |
