Skip to content

Commit

Permalink
Add test for undefined action returned
Browse files Browse the repository at this point in the history
Test for #22343
  • Loading branch information
sheetalkamat committed Mar 6, 2018
1 parent 3bcfed6 commit 6f6c401
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/harness/fourslash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 6f6c401

Please sign in to comment.