File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
test/fixtures/expect-error/values Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ const expectErrorDiagnosticCodesToIgnore = new Set<DiagnosticCode>([
5757 DiagnosticCode . RuntimeWillInvokeDecoratorWithXArgumentsButDecoratorExpectsAtLeastY ,
5858 DiagnosticCode . AcceptsTooFewArgumentsToBeUsedAsDecoratorHere ,
5959 DiagnosticCode . PropertyDoesNotExistOnTypeDidYouMean ,
60+ DiagnosticCode . ErrorIsOfTypeUnknown ,
6061] ) ;
6162
6263type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export enum DiagnosticCode {
6666 MemberCannotHaveOverrideModifierBecauseItIsNotDeclaredInBaseClass = 4113 ,
6767 MemberMustHaveOverrideModifier = 4114 ,
6868 NewExpressionTargetLackingConstructSignatureHasAnyType = 7009 ,
69+ ErrorIsOfTypeUnknown = 18046 ,
6970}
7071
7172export interface Diagnostic {
Original file line number Diff line number Diff line change 1313 expectError ( foo . bar = 'quux' ) ;
1414 expectError ( foo . quux ) ;
1515 }
16- } catch { }
16+ } catch ( error ) {
17+ expectError ( error . code ) ;
18+ }
1719
1820expectError ( hasProperty ( { name : 1 } ) ) ;
1921
Original file line number Diff line number Diff line change 11{
2- "name" : " foo"
2+ "name" : " foo" ,
3+ "tsd" : {
4+ "compilerOptions" : {
5+ "useUnknownInCatchVariables" : true
6+ }
7+ }
38}
You can’t perform that action at this time.
0 commit comments