Skip to content

Commit

Permalink
fix: ts-expect-error issue again
Browse files Browse the repository at this point in the history
  • Loading branch information
harryzcy committed Sep 25, 2023
1 parent 7b603e6 commit f4cac9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ describe('<BrowserOnly>', () => {
.create(
<Context.Provider value>
<BrowserOnly>
{/* @ts-expect-error test */}
<span>{window.location.href}</span>
</BrowserOnly>
</Context.Provider>,
Expand All @@ -49,6 +50,7 @@ describe('<BrowserOnly>', () => {
expect(() => {
renderer.create(
<Context.Provider value>
{/* @ts-expect-error test */}
<BrowserOnly> </BrowserOnly>
</Context.Provider>,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('translate', () => {
it('rejects when no id or message', () => {
// TODO tests are not resolving type defs correctly. We need to include test
// files in a tsconfig file
// @ts-expect-error: TS should protect when both id/message are missing
expect(() => translate({})).toThrowErrorMatchingInlineSnapshot(
`"Docusaurus translation declarations must have at least a translation id or a default translation message"`,
);
Expand Down Expand Up @@ -56,6 +57,7 @@ describe('<Translate>', () => {

it('rejects when no id or message', () => {
expect(() =>
// @ts-expect-error: TS should protect when both id/message are missing
renderer.create(<Translate />),
).toThrowErrorMatchingInlineSnapshot(
`"Docusaurus translation declarations must have at least a translation id or a default translation message"`,
Expand All @@ -67,6 +69,7 @@ describe('<Translate>', () => {
renderer.create(
// eslint-disable-next-line @docusaurus/string-literal-i18n-messages
<Translate id="foo">
{/* @ts-expect-error: for test */}
<span>aaa</span>
</Translate>,
),
Expand Down

0 comments on commit f4cac9e

Please sign in to comment.