Skip to content

Commit 2c33c44

Browse files
author
stevegalili
committed
run with a slow test reporter
1 parent 81e7462 commit 2c33c44

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

examples/cookbook/app/network-requests/__tests__/PhoneBook.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import axios from 'axios';
44
import PhoneBook from '../PhoneBook';
55
import { User } from '../types';
66

7+
jest.setTimeout(10000);
8+
79
describe('PhoneBook', () => {
810
it('fetches contacts successfully and renders in list', async () => {
911
(global.fetch as jest.Mock).mockResolvedValueOnce({

examples/cookbook/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ module.exports = {
33
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
44
setupFilesAfterEnv: ['./jest-setup.ts'],
55
testMatch: ['**/*.test.{ts,tsx}'],
6+
reporters: [['jest-slow-test-reporter', { numTests: 8, warnOnSlowerThan: 300, color: true }]],
67
};

examples/cookbook/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@types/react-native-get-random-values": "^1",
3939
"eslint": "^8.57.0",
4040
"jest": "^29.7.0",
41+
"jest-slow-test-reporter": "^1.0.0",
4142
"react-test-renderer": "18.2.0",
4243
"typescript": "~5.3.3"
4344
},

examples/cookbook/yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6937,6 +6937,13 @@ __metadata:
69376937
languageName: node
69386938
linkType: hard
69396939

6940+
"jest-slow-test-reporter@npm:^1.0.0":
6941+
version: 1.0.0
6942+
resolution: "jest-slow-test-reporter@npm:1.0.0"
6943+
checksum: 10c0/e613596602b0bfa9c1dea651d54cbeaa203136287c8e5949264ffab630dc16548bcbe799087c8212fe72a08f48b3737e596cbea5c1a3caf068517f3be5dcc051
6944+
languageName: node
6945+
linkType: hard
6946+
69406947
"jest-snapshot@npm:^29.7.0":
69416948
version: 29.7.0
69426949
resolution: "jest-snapshot@npm:29.7.0"
@@ -9552,6 +9559,7 @@ __metadata:
95529559
expo-splash-screen: "npm:~0.27.5"
95539560
expo-status-bar: "npm:~1.12.1"
95549561
jest: "npm:^29.7.0"
9562+
jest-slow-test-reporter: "npm:^1.0.0"
95559563
jotai: "npm:^2.8.4"
95569564
nanoid: "npm:^3.3.7"
95579565
react: "npm:18.2.0"

0 commit comments

Comments
 (0)