Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Sep 1, 2020
1 parent e1dbba1 commit 83f1c02
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/definitions-parser/test/module-info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ testo({
expect(Array.from(types.keys())).toEqual(["merges.d.ts"]);
expect(Array.from(tests.keys())).toEqual(["globby-tests.ts", "test/other-tests.ts"]);
},
allReferencedFilesIncludesRelativeTypeReferences() {
const pkg = new Dir(undefined);
pkg.set(
"mock-tests.ts",
`/// <reference types="./addon.pdf" />
`
);
pkg.set("addon.pdf.d.ts", "");
const memFS = new InMemoryFS(pkg, "types/mock");
const { types, tests } = allReferencedFiles(["mock-tests.ts"], memFS, "mock", "types/mock");
expect(Array.from(types.keys())).toEqual(["addon.pdf.d.ts"]);
expect(Array.from(tests.keys())).toEqual(["mock-tests.ts"]);
},
getModuleInfoWorksWithOtherFiles() {
const { types } = getBoringReferences();
// written as if it were from OTHER_FILES.txt
Expand Down

0 comments on commit 83f1c02

Please sign in to comment.