diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/fmt/expected_fmt_check_formatted_files.out | 1 | ||||
-rw-r--r-- | cli/tests/fmt/expected_fmt_check_ignore.out | 1 | ||||
-rw-r--r-- | cli/tests/fmt/expected_fmt_check_tests_dir.out | 2 | ||||
-rw-r--r-- | cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out | 1 | ||||
-rw-r--r-- | cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out | 2 | ||||
-rw-r--r-- | cli/tests/fmt/formatted1.js | 5 | ||||
-rw-r--r-- | cli/tests/fmt/formatted2.ts | 5 | ||||
-rw-r--r-- | cli/tests/fmt_check_tests_dir.out | 2 | ||||
-rw-r--r-- | cli/tests/integration_tests.rs | 14 | ||||
-rw-r--r-- | cli/tests/lint/expected.out | 1 | ||||
-rw-r--r-- | cli/tests/lint/expected_from_stdin.out | 1 | ||||
-rw-r--r-- | cli/tests/lint/expected_glob.out | 1 | ||||
-rw-r--r-- | cli/tests/lint/expected_ignore.out | 1 | ||||
-rw-r--r-- | cli/tests/lint/expected_verbose.out | 3 |
14 files changed, 37 insertions, 3 deletions
diff --git a/cli/tests/fmt/expected_fmt_check_formatted_files.out b/cli/tests/fmt/expected_fmt_check_formatted_files.out new file mode 100644 index 000000000..158c556c2 --- /dev/null +++ b/cli/tests/fmt/expected_fmt_check_formatted_files.out @@ -0,0 +1 @@ +Checked 2 files diff --git a/cli/tests/fmt/expected_fmt_check_ignore.out b/cli/tests/fmt/expected_fmt_check_ignore.out new file mode 100644 index 000000000..c05ac45a1 --- /dev/null +++ b/cli/tests/fmt/expected_fmt_check_ignore.out @@ -0,0 +1 @@ +Checked 1 file diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/fmt/expected_fmt_check_tests_dir.out new file mode 100644 index 000000000..04cd5ec64 --- /dev/null +++ b/cli/tests/fmt/expected_fmt_check_tests_dir.out @@ -0,0 +1,2 @@ +[WILDCARD] +error: Found 1 not formatted file in [WILDCARD] files diff --git a/cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out b/cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out new file mode 100644 index 000000000..158c556c2 --- /dev/null +++ b/cli/tests/fmt/expected_fmt_check_verbose_formatted_files.out @@ -0,0 +1 @@ +Checked 2 files diff --git a/cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out b/cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out new file mode 100644 index 000000000..04cd5ec64 --- /dev/null +++ b/cli/tests/fmt/expected_fmt_check_verbose_tests_dir.out @@ -0,0 +1,2 @@ +[WILDCARD] +error: Found 1 not formatted file in [WILDCARD] files diff --git a/cli/tests/fmt/formatted1.js b/cli/tests/fmt/formatted1.js new file mode 100644 index 000000000..587aa5b96 --- /dev/null +++ b/cli/tests/fmt/formatted1.js @@ -0,0 +1,5 @@ +function foo() { + return 42; +} + +foo(); diff --git a/cli/tests/fmt/formatted2.ts b/cli/tests/fmt/formatted2.ts new file mode 100644 index 000000000..4a8036806 --- /dev/null +++ b/cli/tests/fmt/formatted2.ts @@ -0,0 +1,5 @@ +function bar(): number { + return 42; +} + +bar(); diff --git a/cli/tests/fmt_check_tests_dir.out b/cli/tests/fmt_check_tests_dir.out deleted file mode 100644 index 060f2f17a..000000000 --- a/cli/tests/fmt_check_tests_dir.out +++ /dev/null @@ -1,2 +0,0 @@ -[WILDCARD] -error: Found 1 not formatted file diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 2f70cf050..e00c7a865 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1720,10 +1720,22 @@ itest!(bundle { itest!(fmt_check_tests_dir { args: "fmt --check ./", - output: "fmt_check_tests_dir.out", + output: "fmt/expected_fmt_check_tests_dir.out", exit_code: 1, }); +itest!(fmt_check_formatted_files { + args: "fmt --check fmt/formatted1.js fmt/formatted2.ts", + output: "fmt/expected_fmt_check_formatted_files.out", + exit_code: 0, +}); + +itest!(fmt_check_ignore { + args: "fmt --check --unstable --ignore=fmt/formatted1.js fmt/", + output: "fmt/expected_fmt_check_ignore.out", + exit_code: 0, +}); + itest!(fmt_stdin { args: "fmt -", input: Some("const a = 1\n"), diff --git a/cli/tests/lint/expected.out b/cli/tests/lint/expected.out index a85c90859..eb8a2651a 100644 --- a/cli/tests/lint/expected.out +++ b/cli/tests/lint/expected.out @@ -1,2 +1,3 @@ [WILDCARD] Found 3 problems +Checked 3 files diff --git a/cli/tests/lint/expected_from_stdin.out b/cli/tests/lint/expected_from_stdin.out index 02b9d917c..90f455fdc 100644 --- a/cli/tests/lint/expected_from_stdin.out +++ b/cli/tests/lint/expected_from_stdin.out @@ -1,2 +1,3 @@ [WILDCARD] Found 1 problem +Checked 1 file diff --git a/cli/tests/lint/expected_glob.out b/cli/tests/lint/expected_glob.out index a85c90859..eb8a2651a 100644 --- a/cli/tests/lint/expected_glob.out +++ b/cli/tests/lint/expected_glob.out @@ -1,2 +1,3 @@ [WILDCARD] Found 3 problems +Checked 3 files diff --git a/cli/tests/lint/expected_ignore.out b/cli/tests/lint/expected_ignore.out index 02b9d917c..b5f78ee04 100644 --- a/cli/tests/lint/expected_ignore.out +++ b/cli/tests/lint/expected_ignore.out @@ -1,2 +1,3 @@ [WILDCARD] Found 1 problem +Checked 2 files diff --git a/cli/tests/lint/expected_verbose.out b/cli/tests/lint/expected_verbose.out new file mode 100644 index 000000000..eb8a2651a --- /dev/null +++ b/cli/tests/lint/expected_verbose.out @@ -0,0 +1,3 @@ +[WILDCARD] +Found 3 problems +Checked 3 files |