Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

update e2e tests for export #4579

Merged
merged 1 commit into from
Oct 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 0 additions & 99 deletions packages/expo-cli/e2e/__tests__/__snapshots__/export-test.ts.snap

This file was deleted.

21 changes: 15 additions & 6 deletions packages/expo-cli/e2e/__tests__/export-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,21 @@ for (const isExotic of [false, true]) {
const distPath = path.join(projectRoot, 'dist');

const assetMap = JsonFile.read(path.join(distPath, 'assetmap.json'));
expect(deepRelativizePaths(projectRoot, assetMap)).toMatchSnapshot({}, 'assetmap');
expect(deepRelativizePaths(projectRoot, assetMap)).toEqual({});

const androidIndex = JsonFile.read(path.join(distPath, 'android-index.json'));
expect(androidIndex.bundleUrl).toMatch(
/^https:\/\/example.com\/export-test-app\/bundles\/android-[\w\d]+\.js$/
);

expect(androidIndex).toMatchSnapshot(
{
expect(androidIndex).toEqual(
expect.objectContaining({
bundleUrl: expect.any(String),
commitTime: expect.any(String),
publishedTime: expect.any(String),
releaseId: expect.any(String),
revisionId: expect.any(String),
},
'android-index'
})
);

// List output files with sizes for snapshotting.
Expand All @@ -82,7 +81,17 @@ for (const isExotic of [false, true]) {
return `${path.posix.relative(projectRoot, entry.path)} (${formatFileSize(entry)})`;
});

expect(distFiles).toMatchSnapshot();
expect(distFiles).toEqual(
expect.arrayContaining([
expect.stringContaining('dist/android-index.json '),
expect.stringContaining('dist/assetmap.json '),
expect.stringContaining('dist/assets (dir)'),
expect.stringContaining('dist/bundles (dir)'),
expect.stringContaining('dist/bundles/android-XXX.js '),
expect.stringContaining('dist/bundles/ios-XXX.js '),
expect.stringContaining('dist/ios-index.json '),
])
);
});
});
}
Expand Down