Add test for undefined action returned

Test for #22343
This commit is contained in:
Sheetal Nandi 2018-03-06 11:00:41 -08:00
parent 3bcfed61b6
commit 6f6c40186f
2 changed files with 20 additions and 0 deletions

View file

@ -2923,6 +2923,10 @@ Actual: ${stringify(fullActual)}`);
if (!codeFixes.length) {
this.raiseError(`verifyCodeFixAvailable failed - expected code fixes but none found.`);
}
codeFixes.forEach(fix => fix.changes.forEach(change => {
assert.isObject(change, `Invalid change in code fix: ${JSON.stringify(fix)}`);
change.textChanges.forEach(textChange => assert.isObject(textChange, `Invalid textChange in codeFix: ${JSON.stringify(fix)}`));
}));
if (info) {
assert.equal(info.length, codeFixes.length);
ts.zipWith(codeFixes, info, (fix, info) => {

View file

@ -0,0 +1,16 @@
/// <reference path='fourslash.ts' />
// @noImplicitAny: true
// @Filename: /a.ts
////export class D {}
////export default new D();
// @Filename: /b.ts
////export class C {
//// [|set x(val) {}|]
//// method() { this.x = import("./a"); }
////}
goTo.file("/b.ts");
verify.codeFixAvailable();