Update test that import code fix doesn't use node_modules global import if classic resolution is set (#20453)
This commit is contained in:
parent
272266f0e1
commit
93551ab93b
2 changed files with 10 additions and 5 deletions
|
@ -2522,9 +2522,9 @@ Actual: ${stringify(fullActual)}`);
|
|||
}
|
||||
|
||||
public verifyImportFixAtPosition(expectedTextArray: string[], errorCode?: number) {
|
||||
const ranges = this.getRanges();
|
||||
if (ranges.length === 0) {
|
||||
this.raiseError("At least one range should be specified in the testfile.");
|
||||
const ranges = this.getRanges().filter(r => r.fileName === this.activeFile.fileName);
|
||||
if (ranges.length !== 1) {
|
||||
this.raiseError("Exactly one range should be specified in the testfile.");
|
||||
}
|
||||
|
||||
const codeFixes = this.getCodeFixActions(this.activeFile.fileName, errorCode);
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
////[|foo;|]
|
||||
|
||||
// @Filename: /c.ts
|
||||
////bar;
|
||||
////[|bar;|]
|
||||
|
||||
goTo.file("/a/index.ts");
|
||||
|
||||
goTo.file("/b.ts");
|
||||
// Explicitly imports from "./a/index" and not just from "./a"
|
||||
verify.importFixAtPosition([
|
||||
`import { foo } from "./a/index";
|
||||
|
||||
|
@ -24,4 +25,8 @@ foo;`
|
|||
]);
|
||||
|
||||
goTo.file("/c.ts");
|
||||
// TODO: GH#20050 verify.not.codeFixAvailable();
|
||||
// Does not use a global import for node_modules
|
||||
verify.importFixAtPosition([
|
||||
`import { bar } from "./node_modules/x/index";
|
||||
|
||||
bar;`]);
|
||||
|
|
Loading…
Reference in a new issue