File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1616 "precommit" : " lint-staged" ,
1717 "prepublishOnly" : " npm run clean && npm run build:unmin && npm run build:min" ,
1818 "release" : " standard-version --no-verify" ,
19- "test" : " mocha"
19+ "test" : " mocha" ,
20+ "test:benchmark" : " node ./test/benchmark.js"
2021 },
2122 "repository" : {
2223 "type" : " git" ,
4041 "devDependencies" : {
4142 "@commitlint/cli" : " ^6.1.0" ,
4243 "@commitlint/config-conventional" : " ^6.1.0" ,
44+ "benchmark" : " 2.1.4" ,
4345 "coveralls" : " ^3.0.0" ,
4446 "eslint" : " ^4.18.0" ,
4547 "eslint-plugin-prettier" : " ^2.6.0" ,
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ var Benchmark = require ( 'benchmark' ) ;
4+ var helpers = require ( './helpers/' ) ;
5+ var Parser = require ( '../' ) ;
6+
7+ var suite = new Benchmark . Suite ( ) ;
8+ var mocks = helpers . mocks ;
9+
10+ suite
11+ . add ( 'html-to-react - Single' , function ( ) {
12+ Parser ( mocks . html . single ) ;
13+ } )
14+ . add ( 'html-to-react - Multiple' , function ( ) {
15+ Parser ( mocks . html . multiple ) ;
16+ } )
17+ . add ( 'html-to-react - Complex' , function ( ) {
18+ Parser ( mocks . html . complex ) ;
19+ } )
20+ . on ( 'cycle' , function ( event ) {
21+ process . stdout . write ( String ( event . target ) + '\n' ) ;
22+ } )
23+ . run ( {
24+ minSamples : 100 ,
25+ delay : 2
26+ } ) ;
You can’t perform that action at this time.
0 commit comments