mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add tests
This commit is contained in:
21
tests/cases/fourslash/ambientShorthandFindAllRefs.ts
Normal file
21
tests/cases/fourslash/ambientShorthandFindAllRefs.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: declarations.d.ts
|
||||
////declare module "jquery";
|
||||
|
||||
// @Filename: user.ts
|
||||
////import {[|x|]} from "jquery";
|
||||
|
||||
// @Filename: user2.ts
|
||||
////import {[|x|]} from "jquery";
|
||||
|
||||
let ranges = test.ranges();
|
||||
for (let range of ranges) {
|
||||
goTo.file(range.fileName);
|
||||
goTo.position(range.start);
|
||||
|
||||
verify.referencesCountIs(ranges.length);
|
||||
for (let expectedRange of ranges) {
|
||||
verify.referencesAtPositionContains(expectedRange);
|
||||
}
|
||||
}
|
||||
39
tests/cases/fourslash/ambientShorthandGotoDefinition.ts
Normal file
39
tests/cases/fourslash/ambientShorthandGotoDefinition.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: declarations.d.ts
|
||||
/////*module*/declare module "jquery"
|
||||
|
||||
// @Filename: user.ts
|
||||
///////<reference path="declarations.d.ts"/>
|
||||
////import /*importFoo*/foo, {bar} from "jquery";
|
||||
////import /*importBaz*/* as /*idBaz*/baz from "jquery";
|
||||
/////*importBang*/import /*idBang*/bang = require("jquery");
|
||||
////foo/*useFoo*/(bar/*useBar*/, baz/*useBaz*/, bang/*useBang*/);
|
||||
|
||||
goTo.marker("useFoo");
|
||||
verify.quickInfoIs("import foo");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("importFoo");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("module");
|
||||
|
||||
goTo.marker("useBar");
|
||||
verify.quickInfoIs("import bar");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("module");
|
||||
|
||||
goTo.marker("useBaz");
|
||||
verify.quickInfoIs("import baz");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("importBaz");
|
||||
goTo.marker("idBaz");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("module");
|
||||
|
||||
goTo.marker("useBang");
|
||||
verify.quickInfoIs("import bang = require(\"jquery\")");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("importBang");
|
||||
goTo.marker("idBang");
|
||||
goTo.definition();
|
||||
verify.caretAtMarker("module");
|
||||
Reference in New Issue
Block a user