Skip to content

Commit

Permalink
Ported test suite: ignore-vcs-files
Browse files Browse the repository at this point in the history
- Files inside version control directores are no longer ignored if explicitly provided, but they still are if discovered, by default.
  • Loading branch information
fabiospampinato committed Sep 13, 2024
1 parent e512640 commit 4b35eb4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/__fixtures__/ignore-vcs-files/.hg/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'use strict';
2 changes: 2 additions & 0 deletions test/__fixtures__/ignore-vcs-files/.svn/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* eslint-disable */
'use strict';
1 change: 1 addition & 0 deletions test/__fixtures__/ignore-vcs-files/file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'use strict';
17 changes: 17 additions & 0 deletions test/__tests__/__snapshots__/ignore-vcs-files.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`does not ignore files in version control systems, if manually provided (stderr) 1`] = `""`;

exports[`does not ignore files in version control systems, if manually provided (stdout) 1`] = `
".hg/file.js
.svn/file.js
file.js"
`;

exports[`does not ignore files in version control systems, if manually provided (write) 1`] = `[]`;

exports[`ignores files in version control systems, if discovered (stderr) 1`] = `""`;

exports[`ignores files in version control systems, if discovered (stdout) 1`] = `"file.js"`;

exports[`ignores files in version control systems, if discovered (write) 1`] = `[]`;
21 changes: 21 additions & 0 deletions test/__tests__/ignore-vcs-files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { runCli } from "../utils";

describe("ignores files in version control systems, if discovered", () => {
runCli("ignore-vcs-files", [
"**/file.js",
"-l",
]).test({
status: 1,
});
});

describe("does not ignore files in version control systems, if manually provided", () => {
runCli("ignore-vcs-files", [
".svn/file.js",
".hg/file.js",
"file.js",
"-l",
]).test({
status: 1,
});
});

0 comments on commit 4b35eb4

Please sign in to comment.