Skip to content

Commit

Permalink
Ported test suite: ignore-absolute-path
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Sep 14, 2024
1 parent 8b72856 commit 2e4da3d
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 0 deletions.
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"jest-snapshot-serializer-raw": "^2.0.0",
"nanoexec": "^1.1.0",
"prettier": "3.3.3",
"tiny-dirname": "^1.0.1",
"typescript": "^5.4.5"
}
}
2 changes: 2 additions & 0 deletions test/__fixtures__/ignore-absolute-path/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/ignored/
depth1/ignored/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'use strict';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw Error('This config should not be evaluated since the directory is ignored');
1 change: 1 addition & 0 deletions test/__fixtures__/ignore-absolute-path/ignored/module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'use strict';
1 change: 1 addition & 0 deletions test/__fixtures__/ignore-absolute-path/regular-module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'use strict';
7 changes: 7 additions & 0 deletions test/__tests__/__snapshots__/ignore-absolute-path.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`support absolute filename (stderr) 1`] = `""`;

exports[`support absolute filename (stdout) 1`] = `"regular-module.js"`;

exports[`support absolute filename (write) 1`] = `[]`;
14 changes: 14 additions & 0 deletions test/__tests__/ignore-absolute-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import path from "node:path";
import dirname from "tiny-dirname";
import { runCli } from "../utils";

describe("support absolute filename", () => {
runCli("ignore-absolute-path", [
path.resolve(dirname(import.meta.url), "../__fixtures__/ignore-absolute-path/ignored/module.js"),
path.resolve(dirname(import.meta.url), "../__fixtures__/ignore-absolute-path/depth1/ignored/*.js"),
path.resolve(dirname(import.meta.url), "../__fixtures__/ignore-absolute-path/regular-module.js"),
"-l",
]).test({
status: 1,
});
});

0 comments on commit 2e4da3d

Please sign in to comment.