Skip to content

Commit ece21e7

Browse files
committed
Add tests
1 parent d913a1c commit ece21e7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

packages/definitions-parser/test/definition-parser.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ describe(getTypingInfo, () => {
9494

9595
return expect(getTypingInfo("jquery", dt.pkgFS("jquery"))).resolves.toBeDefined();
9696
});
97+
98+
it("checks that older versions with non-relative imports have wildcard path mappings", () => {
99+
const dt = createMockDT();
100+
const jquery = dt.pkgDir("jquery");
101+
jquery.set(
102+
"JQuery.d.ts",
103+
`import "jquery/component";
104+
`
105+
);
106+
dt.addOldVersionOfPackage("jquery", "1");
107+
return expect(getTypingInfo("jquery", dt.pkgFS("jquery"))).rejects.toThrow(
108+
'jquery: Older version 1 must have a "paths" entry of "jquery/*": ["jquery/v1/*"]'
109+
);
110+
});
97111
});
98112
});
99113
});

0 commit comments

Comments
 (0)