Skip to content

Commit 456938f

Browse files
committed
Adding reassure for performance testing
1 parent 1109164 commit 456938f

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,5 @@ fastlane/screenshots
6565
ios/Pods
6666
ios/Podfile.lock
6767

68-
.eslintcache
68+
.eslintcache
69+
.reassure

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build:docs": "node ./scripts/build-docs.js",
1212
"e2e": "node ./scripts/test-e2e.js --release",
1313
"test": "npm run lint && npm run unit",
14+
"test:perf": "TEST_RUNNER_ARGS='--testMatch **/*.perf.js' reassure measure",
1415
"unit": "jest",
1516
"lint": "eslint src/ example/src --ext .tsx,.ts,.js",
1617
"release": "node ./scripts/release.js",
@@ -44,6 +45,7 @@
4445
"@babel/core": "^7.12.9",
4546
"@babel/eslint-parser": "^7.13.4",
4647
"@babel/runtime": "^7.12.5",
48+
"@testing-library/react-native": "^11.0.0",
4749
"@tsconfig/docusaurus": "^1.0.4",
4850
"@types/lodash": "^4.14.170",
4951
"@types/react": "^17.0.44",
@@ -73,6 +75,7 @@
7375
"react-native-navigation": "^7.23.1",
7476
"react-recipes": "^1.4.0",
7577
"react-test-renderer": "^17.0.2",
78+
"reassure": "^0.4.1",
7679
"semver": "5.x.x",
7780
"shell-utils": "1.x.x",
7881
"typescript": "^4.3.3"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import {measurePerformance} from 'reassure';
3+
import {Calendar, CalendarList} from '../../index';
4+
5+
describe('Playground testing', () => {
6+
const TestCase = () => {
7+
return <Calendar />;
8+
};
9+
const TestCaseList = () => {
10+
return <CalendarList />;
11+
};
12+
13+
it('calendar', async () => {
14+
const measurement = await measurePerformance(<TestCase />);
15+
expect(measurement.meanDuration).toBeLessThan(60);
16+
});
17+
18+
it('calendar list', async () => {
19+
const measurement = await measurePerformance(<TestCaseList />);
20+
expect(measurement.meanDuration).toBeLessThan(100);
21+
});
22+
});

0 commit comments

Comments
 (0)