From 83f1c02d541ba924ee29448c5bfbfccb9913b17a Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Tue, 1 Sep 2020 16:08:02 -0700 Subject: [PATCH] Add tests --- .../definitions-parser/test/module-info.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/definitions-parser/test/module-info.test.ts b/packages/definitions-parser/test/module-info.test.ts index 62797f9276..316e91f80c 100644 --- a/packages/definitions-parser/test/module-info.test.ts +++ b/packages/definitions-parser/test/module-info.test.ts @@ -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", + `/// +` + ); + 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