Skip to content

Commit 771cc6f

Browse files
committed
test: allow extra resolution files for bundle
1 parent 9636490 commit 771cc6f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

test/utils/filePathGenerator.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type TypeEntry = {
2626
fullName: string;
2727
typeName: string;
2828
expectedFilePaths: string[];
29+
extraResolutionFilePaths?: string[];
2930
expectedComponents?: Array<{
3031
name?: string;
3132
type?: MetadataType;
@@ -152,6 +153,7 @@ const testData = {
152153
getFilePath('webapplications/MyWebApp/webapplication.json'),
153154
getFilePath('webapplications/MyWebApp/MyWebApp.webapplication-meta.xml'),
154155
],
156+
extraResolutionFilePaths: [getFilePath('webapplications/MyWebApp/src/index.html')],
155157
expectedComponents: [
156158
{
157159
content: getFilePath('webapplications/MyWebApp'),
@@ -274,7 +276,10 @@ describe('generating virtual tree from component name/type', () => {
274276
expect(filePaths).to.deep.equal(typeEntry.expectedFilePaths);
275277

276278
// part 2: are the files resolvable into the expected component?
277-
const resolver = new MetadataResolver(registryAccess, VirtualTreeContainer.fromFilePaths(filePaths));
279+
const resolutionFilePaths = typeEntry.extraResolutionFilePaths
280+
? filePaths.concat(typeEntry.extraResolutionFilePaths)
281+
: filePaths;
282+
const resolver = new MetadataResolver(registryAccess, VirtualTreeContainer.fromFilePaths(resolutionFilePaths));
278283

279284
const components = resolver.getComponentsFromPath(packageDir);
280285
const expectedComponentsSize = typeEntry.expectedComponents?.length ?? 1;

0 commit comments

Comments
 (0)