Skip to content

Commit 9e282d6

Browse files
authored
Infra/set perf tests (#2151)
* Infra/ set perf test * update prepush script * ignore perf in CI
1 parent faead14 commit 9e282d6

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,4 @@ docs/**/*.md
7373
/ios/Podfile.lock
7474
expoDemo/ios/Pods
7575

76+
.reassure

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@
2121
"pretest": "npm run lint",
2222
"test": "jest",
2323
"test:watch": "jest --watch",
24+
"test:perf": "TEST_RUNNER_ARGS='--testMatch **/*.perf.js' reassure measure",
2425
"lint": "eslint src -c .eslintrc.js --ext .tsx,.ts,.js",
2526
"lint:fix": "eslint src -c .eslintrc.js --fix",
2627
"xcode": "xed ios",
2728
"build:dev": "tsc --p tsconfig.dev.json",
2829
"build": "node scripts/build.js",
29-
"prepush": "npm run build:dev && npm run test",
30+
"pre-push": "npm run build:dev && npm run test",
3031
"docs:deploy": "./scripts/deployDocs.sh",
3132
"docs:build": "node scripts/buildDocs.js",
3233
"snippets:build": "node scripts/generateSnippets.js",
@@ -103,6 +104,7 @@
103104
"react-native-svg": "^12.1.0",
104105
"react-native-svg-transformer": "^0.14.3",
105106
"react-test-renderer": "^17.0.1",
107+
"reassure": "^0.4.1",
106108
"shell-utils": "^1.0.10",
107109
"typescript": "4.3.2"
108110
},
@@ -127,6 +129,7 @@
127129
"setupFiles": [
128130
"./jest-setup.js"
129131
],
132+
"testMatch": ["**/*.spec.(js|tsx)"],
130133
"moduleNameMapper": {
131134
"^react-native-reanimated$": "<rootDir>/node_modules/react-native-reanimated/src/Animated.js"
132135
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import {measurePerformance} from 'reassure';
3+
import {View} from '../../index';
4+
5+
describe('Playground testing', () => {
6+
const TestCase = () => {
7+
return <View/>;
8+
};
9+
10+
it('view', async () => {
11+
const measurement = await measurePerformance(<TestCase/>);
12+
expect(measurement.meanDuration).toBeLessThan(10);
13+
});
14+
});

0 commit comments

Comments
 (0)