Skip to content

Commit

Permalink
Ignore no overload matches error in expectError assertion (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
orta authored and SamVerschueren committed Sep 16, 2019
1 parent 47c7796 commit 03c170b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion source/lib/compiler.ts
Expand Up @@ -22,7 +22,8 @@ const diagnosticCodesToIgnore = new Set<DiagnosticCode>([
DiagnosticCode.CannotAssignToReadOnlyProperty,
DiagnosticCode.TypeIsNotAssignableToOtherType,
DiagnosticCode.GenericTypeRequiresTypeArguments,
DiagnosticCode.ExpectedArgumentsButGotOther
DiagnosticCode.ExpectedArgumentsButGotOther,
DiagnosticCode.NoOverloadMatches
]);

/**
Expand Down
3 changes: 2 additions & 1 deletion source/lib/interfaces.ts
Expand Up @@ -26,7 +26,8 @@ export enum DiagnosticCode {
PropertyDoesNotExistOnType = 2339,
ArgumentTypeIsNotAssignableToParameterType = 2345,
CannotAssignToReadOnlyProperty = 2540,
ExpectedArgumentsButGotOther = 2554
ExpectedArgumentsButGotOther = 2554,
NoOverloadMatches = 2769
}

export interface Diagnostic {
Expand Down
2 changes: 1 addition & 1 deletion source/test/test.ts
Expand Up @@ -189,7 +189,7 @@ test('support setting a custom test directory', async t => {
test('expectError for functions', async t => {
const diagnostics = await m({cwd: path.join(__dirname, 'fixtures/expect-error/functions')});

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

t.true(diagnostics[0].column === 0);
t.true(diagnostics[0].line === 5);
Expand Down

0 comments on commit 03c170b

Please sign in to comment.