Skip to content

Commit

Permalink
test: format instantiation expr in logical expr (#13897)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrabiec committed Dec 5, 2022
1 parent 957b4f2 commit aa34209
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Expand Up @@ -54,6 +54,39 @@ interface Example {
================================================================================
`;
exports[`logical-expr.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
export class Foo<T> {
message: string;
}
function sample(error: unknown) {
if (!(error instanceof Foo<'some-type'> || error instanceof Error) || !error.message) {
return 'something';
}
}
=====================================output=====================================
export class Foo<T> {
message: string;
}
function sample(error: unknown) {
if (
!(error instanceof Foo<"some-type"> || error instanceof Error) ||
!error.message
) {
return "something";
}
}
================================================================================
`;
exports[`new.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
Expand Down
@@ -0,0 +1,9 @@
export class Foo<T> {
message: string;
}

function sample(error: unknown) {
if (!(error instanceof Foo<'some-type'> || error instanceof Error) || !error.message) {
return 'something';
}
}

0 comments on commit aa34209

Please sign in to comment.