Skip to content

Commit 077dfff

Browse files
author
Andy Hanson
committed
Add tests
1 parent d973f4d commit 077dfff

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @Filename: declarations.d.ts
4+
////declare module "jquery";
5+
6+
// @Filename: user.ts
7+
////import {[|x|]} from "jquery";
8+
9+
// @Filename: user2.ts
10+
////import {[|x|]} from "jquery";
11+
12+
let ranges = test.ranges();
13+
for (let range of ranges) {
14+
goTo.file(range.fileName);
15+
goTo.position(range.start);
16+
17+
verify.referencesCountIs(ranges.length);
18+
for (let expectedRange of ranges) {
19+
verify.referencesAtPositionContains(expectedRange);
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
// @Filename: declarations.d.ts
4+
/////*module*/declare module "jquery"
5+
6+
// @Filename: user.ts
7+
///////<reference path="declarations.d.ts"/>
8+
////import /*importFoo*/foo, {bar} from "jquery";
9+
////import /*importBaz*/* as /*idBaz*/baz from "jquery";
10+
/////*importBang*/import /*idBang*/bang = require("jquery");
11+
////foo/*useFoo*/(bar/*useBar*/, baz/*useBaz*/, bang/*useBang*/);
12+
13+
goTo.marker("useFoo");
14+
verify.quickInfoIs("import foo");
15+
goTo.definition();
16+
verify.caretAtMarker("importFoo");
17+
goTo.definition();
18+
verify.caretAtMarker("module");
19+
20+
goTo.marker("useBar");
21+
verify.quickInfoIs("import bar");
22+
goTo.definition();
23+
verify.caretAtMarker("module");
24+
25+
goTo.marker("useBaz");
26+
verify.quickInfoIs("import baz");
27+
goTo.definition();
28+
verify.caretAtMarker("importBaz");
29+
goTo.marker("idBaz");
30+
goTo.definition();
31+
verify.caretAtMarker("module");
32+
33+
goTo.marker("useBang");
34+
verify.quickInfoIs("import bang = require(\"jquery\")");
35+
goTo.definition();
36+
verify.caretAtMarker("importBang");
37+
goTo.marker("idBang");
38+
goTo.definition();
39+
verify.caretAtMarker("module");

0 commit comments

Comments
 (0)