Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit468e3bd

Browse files
authored
test: fixESLint tests (#19021)
1 parent19e68d3 commit468e3bd

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

‎tests/lib/eslint/eslint.js‎

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ describe("ESLint", () => {
928928

929929
it("should throw if eslint.config.js file is not present even if overrideConfig was passed",async()=>{
930930
eslint=newESLint({
931+
flags,
931932
cwd:getFixturePath(".."),
932933
overrideConfig:{
933934
rules:{
@@ -1525,26 +1526,28 @@ describe("ESLint", () => {
15251526

15261527
it("should throw if eslint.config.js file is not present even if overrideConfig was passed",async()=>{
15271528
eslint=newESLint({
1529+
flags,
15281530
cwd:getFixturePath(".."),
15291531
overrideConfig:{
15301532
rules:{
15311533
"no-unused-vars":2
15321534
}
15331535
}
15341536
});
1535-
awaitassert.rejects(()=>eslint.lintFiles("fixtures/undef*.js"),/Couldnotfindconfigfile/u);
1537+
awaitassert.rejects(()=>eslint.lintFiles("no-config/no-config-file/*.js"),/Couldnotfindconfigfile/u);
15361538
});
15371539

15381540
it("should throw if eslint.config.js file is not present even if overrideConfig was passed and a file path is given",async()=>{
15391541
eslint=newESLint({
1542+
flags,
15401543
cwd:getFixturePath(".."),
15411544
overrideConfig:{
15421545
rules:{
15431546
"no-unused-vars":2
15441547
}
15451548
}
15461549
});
1547-
awaitassert.rejects(()=>eslint.lintFiles("fixtures/undef.js"),/Couldnotfindconfigfile/u);
1550+
awaitassert.rejects(()=>eslint.lintFiles("no-config/no-config-file/foo.js"),/Couldnotfindconfigfile/u);
15481551
});
15491552

15501553
it("should not throw if eslint.config.js file is not present and overrideConfigFile is `true`",async()=>{
@@ -4643,7 +4646,7 @@ describe("ESLint", () => {
46434646
});
46444647
});
46454648

4646-
it("should throw ifnon-booleanvalue is given to 'options.warnIgnored' option",async()=>{
4649+
it("should throw ifan invalidvalue is given to 'patterns' argument",async()=>{
46474650
eslint=newESLint({ flags});
46484651
awaitassert.rejects(()=>eslint.lintFiles(777),/'patterns'mustbeanon-emptystringoranarrayofnon-emptystrings/u);
46494652
awaitassert.rejects(()=>eslint.lintFiles([null]),/'patterns'mustbeanon-emptystringoranarrayofnon-emptystrings/u);
@@ -5955,20 +5958,6 @@ describe("ESLint", () => {
59555958
assert.strictEqual(results[0].output,void0);
59565959
});
59575960

5958-
it("should not fix any rules when fixTypes is used without fix",async()=>{
5959-
eslint=newESLint({
5960-
flags,
5961-
cwd:path.join(fixtureDir,".."),
5962-
overrideConfigFile:true,
5963-
fix:false,
5964-
fixTypes:["layout"]
5965-
});
5966-
constinputPath=getFixturePath("fix-types/fix-only-semi.js");
5967-
constresults=awaiteslint.lintFiles([inputPath]);
5968-
5969-
assert.strictEqual(results[0].output,void0);
5970-
});
5971-
59725961
it("should not fix non-style rules when fixTypes has only 'layout'",async()=>{
59735962
eslint=newESLint({
59745963
flags,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp