Skip to content

Commit 03c170b

Browse files
ortaSamVerschueren
authored andcommitted
Ignore no overload matches error in expectError assertion (#33)
1 parent 47c7796 commit 03c170b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

source/lib/compiler.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const diagnosticCodesToIgnore = new Set<DiagnosticCode>([
2222
DiagnosticCode.CannotAssignToReadOnlyProperty,
2323
DiagnosticCode.TypeIsNotAssignableToOtherType,
2424
DiagnosticCode.GenericTypeRequiresTypeArguments,
25-
DiagnosticCode.ExpectedArgumentsButGotOther
25+
DiagnosticCode.ExpectedArgumentsButGotOther,
26+
DiagnosticCode.NoOverloadMatches
2627
]);
2728

2829
/**

source/lib/interfaces.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export enum DiagnosticCode {
2626
PropertyDoesNotExistOnType = 2339,
2727
ArgumentTypeIsNotAssignableToParameterType = 2345,
2828
CannotAssignToReadOnlyProperty = 2540,
29-
ExpectedArgumentsButGotOther = 2554
29+
ExpectedArgumentsButGotOther = 2554,
30+
NoOverloadMatches = 2769
3031
}
3132

3233
export interface Diagnostic {

source/test/test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ test('support setting a custom test directory', async t => {
189189
test('expectError for functions', async t => {
190190
const diagnostics = await m({cwd: path.join(__dirname, 'fixtures/expect-error/functions')});
191191

192-
t.true(diagnostics.length === 1);
192+
t.true(diagnostics.length === 1, `Diagnostics: ${diagnostics.map(d => d.message)}`);
193193

194194
t.true(diagnostics[0].column === 0);
195195
t.true(diagnostics[0].line === 5);

0 commit comments

Comments
 (0)