This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch
jest-runner-prettier
to work with Prettier 3 (#2363)
# Summary I completely forgot about keplersj/jest-runner-prettier#586 and this has been broken for a while. # Test Plan This is why I love `pnpm` ```shell pnpm patch jest-runner-prettier # add the awaits everywhere pnpm patch-commit '/tmp/67d6a1a8e116289cd91a5e6eeb4f413d' ``` Break formatting in a file. `pnpm test:prettier`. Finally it registers.
- Loading branch information
1 parent
0a19b75
commit 5908de2
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,9 @@ | |
"jsdom": "^22", | ||
"mock-socket": "^9.3.1", | ||
"shelljs": ">=0.8.5" | ||
}, | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
}, | ||
"prettier": "@solana/prettier-config-solana" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/dist/run.js b/dist/run.js | ||
index fdee17d2377dd013d55de1d54bee9d241894e800..7139e496da63da74b3e7966f4a3f5a613a7f3b3b 100644 | ||
--- a/dist/run.js | ||
+++ b/dist/run.js | ||
@@ -11,7 +11,7 @@ export default async ({ testPath }) => { | ||
...config, | ||
filepath: testPath, | ||
}; | ||
- const isPretty = prettier.check(contents, prettierConfig); | ||
+ const isPretty = await prettier.check(contents, prettierConfig); | ||
if (isPretty) { | ||
return pass({ | ||
start, | ||
@@ -19,7 +19,7 @@ export default async ({ testPath }) => { | ||
test: { path: testPath }, | ||
}); | ||
} | ||
- const formatted = prettier.format(contents, prettierConfig); | ||
+ const formatted = await prettier.format(contents, prettierConfig); | ||
return fail({ | ||
start, | ||
end: Date.now(), | ||
diff --git a/src/run.ts b/src/run.ts | ||
index 1775851defdca87b753f1f9bae1cb663332eb640..b6c72e13f82d9e9ed3aef5095f8b8d82e2b4391b 100644 | ||
--- a/src/run.ts | ||
+++ b/src/run.ts | ||
@@ -19,7 +19,7 @@ export default async ({ testPath }: Parameters): Promise<TestResult> => { | ||
filepath: testPath, | ||
}; | ||
|
||
- const isPretty = prettier.check(contents, prettierConfig); | ||
+ const isPretty = await prettier.check(contents, prettierConfig); | ||
if (isPretty) { | ||
return pass({ | ||
start, | ||
@@ -28,7 +28,7 @@ export default async ({ testPath }: Parameters): Promise<TestResult> => { | ||
}); | ||
} | ||
|
||
- const formatted = prettier.format(contents, prettierConfig); | ||
+ const formatted = await prettier.format(contents, prettierConfig); | ||
|
||
return fail({ | ||
start, |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.