File tree 4 files changed +11
-2
lines changed
test/fixtures/expect-error/values
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>([
57
57
DiagnosticCode . RuntimeWillInvokeDecoratorWithXArgumentsButDecoratorExpectsAtLeastY ,
58
58
DiagnosticCode . AcceptsTooFewArgumentsToBeUsedAsDecoratorHere ,
59
59
DiagnosticCode . PropertyDoesNotExistOnTypeDidYouMean ,
60
+ DiagnosticCode . ErrorIsOfTypeUnknown ,
60
61
] ) ;
61
62
62
63
type IgnoreDiagnosticResult = 'preserve' | 'ignore' | Location ;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export enum DiagnosticCode {
66
66
MemberCannotHaveOverrideModifierBecauseItIsNotDeclaredInBaseClass = 4113 ,
67
67
MemberMustHaveOverrideModifier = 4114 ,
68
68
NewExpressionTargetLackingConstructSignatureHasAnyType = 7009 ,
69
+ ErrorIsOfTypeUnknown = 18046 ,
69
70
}
70
71
71
72
export interface Diagnostic {
Original file line number Diff line number Diff line change 13
13
expectError ( foo . bar = 'quux' ) ;
14
14
expectError ( foo . quux ) ;
15
15
}
16
- } catch { }
16
+ } catch ( error ) {
17
+ expectError ( error . code ) ;
18
+ }
17
19
18
20
expectError ( hasProperty ( { name : 1 } ) ) ;
19
21
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " foo"
2
+ "name" : " foo" ,
3
+ "tsd" : {
4
+ "compilerOptions" : {
5
+ "useUnknownInCatchVariables" : true
6
+ }
7
+ }
3
8
}
You can’t perform that action at this time.
0 commit comments