Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[router] enable testing on all platforms #27407

Merged
merged 5 commits into from Mar 13, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-router/CHANGELOG.md
Expand Up @@ -26,6 +26,8 @@

### 💡 Others

- Enable Jest tests for all platforms ([#27407](https://github.com/expo/expo/pull/27407) by [@marklawlor](https://github.com/marklawlor))

## 3.4.8 - 2024-02-29

### 🎉 New features
Expand Down
8 changes: 4 additions & 4 deletions packages/expo-router/jest.config.js
@@ -1,8 +1,8 @@
const {
getWebPreset,
// getNodePreset,
getNodePreset,
getIOSPreset,
// getAndroidPreset,
getAndroidPreset,
} = require('jest-expo/config/getPlatformPreset');
const { withWatchPlugins } = require('jest-expo/config/withWatchPlugins');

Expand All @@ -19,8 +19,8 @@ module.exports = withWatchPlugins({
projects: [
// Create a new project for each platform.
getWebPreset(),
// getNodePreset(),
getNodePreset(),
getIOSPreset(),
// getAndroidPreset(),
getAndroidPreset(),
].map(withDefaults),
});
@@ -1,3 +1,4 @@
/** @jest-environment jsdom */
Copy link
Contributor Author

@marklawlor marklawlor Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test uses import { render } from '@testing-library/react'; which assumes there is a DOM environment.

It looks like there is progress being made for better support for SSR and RSC

import { render } from '@testing-library/react';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
Expand Down