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

Commit

Permalink
update e2e tests for export (#4579)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon authored Oct 28, 2022
1 parent 68fdef1 commit 077a1e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 105 deletions.
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

0 comments on commit 077a1e9

Please sign in to comment.