diff --git a/lib/types.js b/lib/types.js index 400b0d47..c71d7be4 100755 --- a/lib/types.js +++ b/lib/types.js @@ -33,7 +33,8 @@ const internals = { 2540, // Cannot assign to readonly property 2322, // Type is not assignable to other type 2314, // Generic type requires type arguments - 2554 // Expected arguments but got other + 2554, // Expected arguments but got other + 2769 // No overload matches this call ] }; diff --git a/test/cli_coverage/node_modules/module/module.js b/test/cli_coverage/node_modules/module/module.js deleted file mode 100644 index feebadc7..00000000 --- a/test/cli_coverage/node_modules/module/module.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -// Load modules - - -// Declare internals - -const internals = {}; - - -exports.method = function (value) { - - return value; -}; diff --git a/test/types.js b/test/types.js index 20e8dffa..d3847ff0 100755 --- a/test/types.js +++ b/test/types.js @@ -62,69 +62,89 @@ describe('Types', () => { const errors = await Lab.types.validate(); expect(errors).to.only.contain([ { - column: 4, filename: 'test/index.ts', + message: 'No overload matches this call.\n' + + ` Overload 1 of 2, '(a: string, b: string): string', gave the following error.\n` + + ` Argument of type '1' is not assignable to parameter of type 'string'.\n` + + ` Overload 2 of 2, '(a: number, b: number): number', gave the following error.\n` + + ` Argument of type '"x"' is not assignable to parameter of type 'number'.`, line: 3, - message: 'Argument of type \'"x"\' is not assignable to parameter of type \'number\'.' + column: 0 }, { - column: 7, filename: 'test/index.ts', + message: 'No overload matches this call.\n' + + ` Overload 1 of 2, '(a: string, b: string): string', gave the following error.\n` + + ` Argument of type '1' is not assignable to parameter of type 'string'.\n` + + ` Overload 2 of 2, '(a: number, b: number): number', gave the following error.\n` + + ` Argument of type '"x"' is not assignable to parameter of type 'number'.`, line: 4, - message: 'Argument of type \'"x"\' is not assignable to parameter of type \'number\'.' + column: 0 }, { - column: 7, filename: 'test/nested.ts', + message: 'No overload matches this call.\n' + + ` Overload 1 of 2, '(a: string, b: string): string', gave the following error.\n` + + ` Argument of type '1' is not assignable to parameter of type 'string'.\n` + + ` Overload 2 of 2, '(a: number, b: number): number', gave the following error.\n` + + ` Argument of type 'true' is not assignable to parameter of type 'number'.`, line: 8, - message: 'Argument of type \'true\' is not assignable to parameter of type \'number\'.' + column: 0 }, { - column: 49, filename: 'test/nested.ts', + message: 'No overload matches this call.\n' + + ` Overload 1 of 2, '(a: string, b: string): string', gave the following error.\n` + + ` Argument of type '1' is not assignable to parameter of type 'string'.\n` + + ` Overload 2 of 2, '(a: number, b: number): number', gave the following error.\n` + + ` Argument of type 'true' is not assignable to parameter of type 'number'.`, line: 8, - message: 'Argument of type \'true\' is not assignable to parameter of type \'number\'.' + column: 42 }, { - column: 4, filename: 'test/other.ts', + message: 'No overload matches this call.\n' + + ` Overload 1 of 2, '(a: string, b: string): string', gave the following error.\n` + + ` Argument of type 'true' is not assignable to parameter of type 'string'.\n` + + ` Overload 2 of 2, '(a: number, b: number): number', gave the following error.\n` + + ` Argument of type 'true' is not assignable to parameter of type 'number'.`, line: 3, - message: 'Argument of type \'true\' is not assignable to parameter of type \'number\'.' + column: 4 }, { - column: 26, filename: 'test/syntax.ts', + message: `')' expected.`, line: 8, - message: '\')\' expected.' + column: 26 }, { - column: 21, filename: 'test/syntax.ts', + message: `',' expected.`, line: 9, - message: '\',\' expected.' + column: 21 }, { - column: 0, filename: 'test/syntax.ts', line: 8, + column: 0, message: 'Expected an error' }, { - column: 0, filename: 'test/syntax.ts', line: 9, + column: 0, message: 'Expected an error' }, { - column: 0, filename: 'test/value.ts', line: 9, + column: 0, message: 'Expected an error' }, { - column: 8, filename: 'test/value.ts', line: 17, + column: 8, message: 'Expected an error' } ]);