performance-testing-cli
v1.1.1
Published
You can measure render time with react-performance-testing in unit test correctly
Downloads
7
Readme
performance-testing-cli
If you use renderTime
, you can get benefit by using this lib with react-performance-testing. This lib is created to improve DX for react-performance-test users. You can execute all test at once by using this library.
Table of Contents
Installation
npm:
npm install --save-dev performance-testing-cli
yarn:
yarn add --dev performance-testing-cli
Usage
You can test render time at once. But you should write one test case in one file. Because node.js has feature called inline caching. Inline caching is make our code be fast but we can not measure render time correctly.
But this library resolve this problem by executing test in another process.
You can use as below.
perf --cmd='jest' --root='dir'
Note: You need to separate directory to generally test and renderTime
test.
You can check example here.
Options
cmd(required) ... Specify your test command like
jest
,mocha
.root(required) ... Specify your root directory you want to test performance.
match ... Specify your regexp. Using micromatch. default:
**/*.(test|spec).(j|t)s(x)?
.If you specify file path as below, you can test one by one.
perf --cmd='jest' ./dir/filename.js
Even if you specify root
option, filename.js
has priority.
perf --cmd='jest' --root='rootDir' ./dir/filename.js