summaryrefslogtreecommitdiff
path: root/tests/specs/fmt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/fmt')
-rw-r--r--tests/specs/fmt/gitignore/.gitignore1
-rw-r--r--tests/specs/fmt/gitignore/__test__.jsonc6
-rw-r--r--tests/specs/fmt/gitignore/dist/file1.js6
-rw-r--r--tests/specs/fmt/gitignore/expected.out10
-rw-r--r--tests/specs/fmt/gitignore/file2.ts3
5 files changed, 26 insertions, 0 deletions
diff --git a/tests/specs/fmt/gitignore/.gitignore b/tests/specs/fmt/gitignore/.gitignore
new file mode 100644
index 000000000..838458f20
--- /dev/null
+++ b/tests/specs/fmt/gitignore/.gitignore
@@ -0,0 +1 @@
+/dist/ \ No newline at end of file
diff --git a/tests/specs/fmt/gitignore/__test__.jsonc b/tests/specs/fmt/gitignore/__test__.jsonc
new file mode 100644
index 000000000..94804c3fe
--- /dev/null
+++ b/tests/specs/fmt/gitignore/__test__.jsonc
@@ -0,0 +1,6 @@
+{
+ "tempDir": true,
+ "args": "fmt --check",
+ "output": "expected.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/fmt/gitignore/dist/file1.js b/tests/specs/fmt/gitignore/dist/file1.js
new file mode 100644
index 000000000..3ecf5aa6a
--- /dev/null
+++ b/tests/specs/fmt/gitignore/dist/file1.js
@@ -0,0 +1,6 @@
+// This file is in `.gitignore` simulating that it's generated by a build tool
+// and should not be linted
+function foo( ) {
+ console.log( "hello")
+ }
+ \ No newline at end of file
diff --git a/tests/specs/fmt/gitignore/expected.out b/tests/specs/fmt/gitignore/expected.out
new file mode 100644
index 000000000..73568ff3a
--- /dev/null
+++ b/tests/specs/fmt/gitignore/expected.out
@@ -0,0 +1,10 @@
+
+from [WILDCARD]file2.ts:
+1 | -function foo( ): any {
+1 | +function foo(): any {
+2 | - console.log( "hello")
+2 | + console.log("hello");
+3 | - }
+3 | +}
+
+error: Found 1 not formatted file in 1 file
diff --git a/tests/specs/fmt/gitignore/file2.ts b/tests/specs/fmt/gitignore/file2.ts
new file mode 100644
index 000000000..0e5fdd36d
--- /dev/null
+++ b/tests/specs/fmt/gitignore/file2.ts
@@ -0,0 +1,3 @@
+function foo( ): any {
+ console.log( "hello")
+ }