Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## master

### Fixes

* `[jest-haste-map]` Properly handle platform-specific file deletions
([#5534](https://github.com/facebook/jest/pull/5534))

### Features

* `[jest-util]` Add the following methods to the "console" implementations:
Expand Down
4 changes: 1 addition & 3 deletions packages/jest-haste-map/src/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ describe('HasteMap', () => {
});
});

it('correctly handles platform-specific file deletions (broken)', async () => {
it('correctly handles platform-specific file deletions', async () => {
mockFs = Object.create(null);
mockFs['/fruits/strawberry.js'] = [
'/**',
Expand All @@ -613,8 +613,6 @@ describe('HasteMap', () => {
({__hasteMapForTest: data} = await new HasteMap(defaultConfig).build());
expect(data.map['Strawberry']).toEqual({
g: ['/fruits/strawberry.js', 0],
// FIXME: this file should NOT exist anymore!
ios: ['/fruits/strawberry.ios.js', 0],
});
});

Expand Down
14 changes: 12 additions & 2 deletions packages/jest-haste-map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,18 @@ class HasteMap extends EventEmitter {
if (fileMetadata[H.VISITED]) {
if (!fileMetadata[H.ID]) {
return null;
} else if (fileMetadata[H.ID] && moduleMetadata) {
map[fileMetadata[H.ID]] = moduleMetadata;
}
if (moduleMetadata != null) {
const platform =
getPlatformExtension(filePath, this._options.platforms) ||
H.GENERIC_PLATFORM;
const module = moduleMetadata[platform];
if (module == null) {
return null;
}
const modulesByPlatform =
map[fileMetadata[H.ID]] || (map[fileMetadata[H.ID]] = {});
modulesByPlatform[platform] = module;
return null;
}
}
Expand Down
4 changes: 3 additions & 1 deletion website/pages/en/videos.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class Videos extends React.Component {
({title, description, type, url}, index) => {
const textMarkup = (
<div className="blockContent">
<h2><a href={url}>{title}</a></h2>
<h2>
<a href={url}>{title}</a>
</h2>
<div>
<MarkdownBlock>{description}</MarkdownBlock>
</div>
Expand Down