MCPcopy Create free account
hub / github.com/babel/minify / test

Method test

scripts/benchmark.js:81–102  ·  view source on GitHub ↗
(fn, arg, warmup = false)

Source from the content-addressed store, hash-verified

79 return result;
80 }
81 test(fn, arg, warmup = false) {
82 // eslint-disable-line
83 if (DEBUG) console.error(`Running ${fn.name}`);
84
85 // warm up
86 if (warmup) fn.call(null, arg);
87
88 const start = process.hrtime();
89 const output = fn.call(null, arg);
90 const delta = process.hrtime(start);
91
92 const gzipped = zlib.gzipSync(output);
93 const parseTime = this.getParseTime(output);
94
95 return {
96 name: fn.name,
97 output,
98 gzipped,
99 parseTime,
100 time: delta[0] * 1e3 + delta[1] / 1e6
101 };
102 }
103 "babel-minify"(code) {
104 return babel.transform(code, {
105 sourceType: "script",

Callers 1

runFileMethod · 0.95

Calls 1

getParseTimeMethod · 0.95

Tested by

no test coverage detected