Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add ignore-emoji tests #23

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/__fixtures__/ignore-emoji/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignored
3 changes: 3 additions & 0 deletions test/__fixtures__/ignore-emoji/ignored/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const foo
= 'bar'
;
3 changes: 3 additions & 0 deletions test/__fixtures__/ignore-emoji/ignored/中文.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const foo
= 'bar'
;
3 changes: 3 additions & 0 deletions test/__fixtures__/ignore-emoji/ignored/😁.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const foo
= 'bar'
;
3 changes: 3 additions & 0 deletions test/__fixtures__/ignore-emoji/not-ignored.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const foo
= 'bar'
;
13 changes: 13 additions & 0 deletions test/__tests__/__snapshots__/ignore-emoji.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ignores file name contains emoji (stderr) 1`] = `""`;

exports[`ignores file name contains emoji (stdout) 1`] = `"not-ignored.js"`;

exports[`ignores file name contains emoji (write) 1`] = `[]`;

exports[`stdin (stderr) 1`] = `""`;

exports[`stdin (stdout) 1`] = `".name { display: none; }"`;

exports[`stdin (write) 1`] = `[]`;
16 changes: 16 additions & 0 deletions test/__tests__/ignore-emoji.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { runCli } from "../utils";

describe("ignores file name contains emoji", () => {
runCli("ignore-emoji", ["**/*.js", "-l"]).test({
status: 1,
});
});

// TODO (43081j): re-enable once we fix #21
describe.skip("stdin", () => {
runCli("ignore-emoji", ["--stdin-filepath", "ignored/我的样式.css"], {
input: ".name { display: none; }",
}).test({
status: 0,
});
});