mirror of
https://github.com/r0adkll/sign-android-release
synced 2026-09-27 07:08:37 +00:00
bump jest and make tests pass
This commit is contained in:
+21
-6
@@ -16,7 +16,6 @@
|
||||
/* eslint import/no-extraneous-dependencies: "off" */
|
||||
|
||||
const Benchmark = require('benchmark');
|
||||
|
||||
const diffBaseline = require('diff').diffLines;
|
||||
const diffImproved = require('../build/index.js').default;
|
||||
|
||||
@@ -39,7 +38,7 @@ const testBaseline = (a, b) => {
|
||||
return benchmark.stats;
|
||||
};
|
||||
|
||||
const testImproved = function(a, b) {
|
||||
const testImproved = function (a, b) {
|
||||
const benchmark = new Benchmark({
|
||||
fn() {
|
||||
// Split string arguments to make fair comparison with baseline.
|
||||
@@ -140,12 +139,28 @@ const testLength = n => {
|
||||
writeHeading3(n);
|
||||
|
||||
[2, 4, 8].forEach(tenth => {
|
||||
testDeleteInsert(tenth, all, getItems(n, i => i % 10 >= tenth && `${i}`));
|
||||
testDeleteInsert(
|
||||
tenth,
|
||||
all,
|
||||
getItems(n, i => i % 10 >= tenth && `${i}`),
|
||||
);
|
||||
});
|
||||
testChange(1, all, getItems(n, i => (i % 10 === 0 ? `x${i}` : `${i}`)));
|
||||
testChange(
|
||||
1,
|
||||
all,
|
||||
getItems(n, i => (i % 10 === 0 ? `x${i}` : `${i}`)),
|
||||
);
|
||||
testChange(2, all, getItems(n, change2));
|
||||
testChange(5, all, getItems(n, i => (i % 2 === 0 ? `x${i}` : `${i}`)));
|
||||
testChange(10, all, getItems(n, i => `x${i}`)); // simulate TDD
|
||||
testChange(
|
||||
5,
|
||||
all,
|
||||
getItems(n, i => (i % 2 === 0 ? `x${i}` : `${i}`)),
|
||||
);
|
||||
testChange(
|
||||
10,
|
||||
all,
|
||||
getItems(n, i => `x${i}`),
|
||||
); // simulate TDD
|
||||
};
|
||||
|
||||
writeHeading2();
|
||||
|
||||
Reference in New Issue
Block a user