• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/// <reference path="fourslash.ts" />
2
3// This is the same test as pathCompletionsTypesVersionsWildcard5, but
4// with the path patterns shuffled to ensure iteration order doesn't matter.
5
6// @module: commonjs
7
8// @Filename: /node_modules/foo/package.json
9//// {
10////   "types": "index.d.ts",
11////   "typesVersions": {
12////     "*": {
13////       "bar/*": ["dist/*"],
14////       "exact-match": ["dist/index.d.ts"],
15////       "foo/*": ["dist/*"],
16////       "*": ["dist/*"]
17////     }
18////   }
19//// }
20
21// @Filename: /node_modules/foo/nope.d.ts
22//// export const nope = 0;
23
24// @Filename: /node_modules/foo/dist/index.d.ts
25//// export const index = 0;
26
27// @Filename: /node_modules/foo/dist/blah.d.ts
28//// export const blah = 0;
29
30// @Filename: /node_modules/foo/dist/foo/onlyInFooFolder.d.ts
31//// export const foo = 0;
32
33// @Filename: /node_modules/foo/dist/subfolder/one.d.ts
34//// export const one = 0;
35
36// @Filename: /a.ts
37//// import { } from "foo//**/";
38
39verify.completions({
40  marker: "",
41  isNewIdentifierLocation: true,
42  exact: ["bar", "exact-match", "foo", "blah", "index", "subfolder"],
43});
44
45edit.insert("foo/");
46
47verify.completions({
48  isNewIdentifierLocation: true,
49  exact: ["blah", "index", "foo", "subfolder"],
50});
51
52edit.insert("foo/");
53
54verify.completions({
55  isNewIdentifierLocation: true,
56  exact: ["onlyInFooFolder"],
57});
58