summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorTaisuke Fukuno <fukuno@jig.jp>2020-06-06 06:01:44 +0900
committerGitHub <noreply@github.com>2020-06-05 17:01:44 -0400
commitd2243b1125722e775b1f9719197260d1cda1220d (patch)
tree27778e56fd6ac324cb4780ab88546d2dd5982fd3 /cli
parent18670c47e69ec2b9ceef6ec0011fbbdc4b845be6 (diff)
deno test should run mjs files (#6122)
Diffstat (limited to 'cli')
-rw-r--r--cli/flags.rs2
-rw-r--r--cli/test_runner.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/cli/flags.rs b/cli/flags.rs
index 1eebb8b87..2c201fcb6 100644
--- a/cli/flags.rs
+++ b/cli/flags.rs
@@ -1022,7 +1022,7 @@ report results to standard output:
deno test src/fetch_test.ts src/signal_test.ts
Directory arguments are expanded to all contained files matching the glob
-{*_,*.,}test.{js,ts,jsx,tsx}:
+{*_,*.,}test.{js,mjs,ts,jsx,tsx}:
deno test src/",
)
}
diff --git a/cli/test_runner.rs b/cli/test_runner.rs
index 3e3ed1291..b4623fc9f 100644
--- a/cli/test_runner.rs
+++ b/cli/test_runner.rs
@@ -14,14 +14,17 @@ fn is_supported(p: &Path) -> bool {
basename.ends_with("_test.ts")
|| basename.ends_with("_test.tsx")
|| basename.ends_with("_test.js")
+ || basename.ends_with("_test.mjs")
|| basename.ends_with("_test.jsx")
|| basename.ends_with(".test.ts")
|| basename.ends_with(".test.tsx")
|| basename.ends_with(".test.js")
+ || basename.ends_with(".test.mjs")
|| basename.ends_with(".test.jsx")
|| basename == "test.ts"
|| basename == "test.tsx"
|| basename == "test.js"
+ || basename == "test.mjs"
|| basename == "test.jsx"
} else {
false