Run additional tests to ensure compilation stablility

This commit is contained in:
Tobias Koppers 2018-10-19 11:39:06 +02:00
parent 1d9f8a332f
commit c8252e6e4d
2 changed files with 31 additions and 0 deletions

View File

@ -32,6 +32,10 @@ matrix:
node_js: "10"
env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
stage: advanced
- os: linux
node_js: "10"
env: NO_WATCH_TESTS=1 ALTERNATIVE_SORT=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration
stage: versions
- os: osx
node_js: "10"
env: NO_WATCH_TESTS=1 JEST="--maxWorkers=2 --cacheDirectory .jest-cache" JOB_PART=integration

View File

@ -23,3 +23,30 @@ expect.extend({
return { message, pass };
}
});
if (process.env.ALTERNATIVE_SORT) {
const oldSort = Array.prototype.sort;
Array.prototype.sort = function(cmp) {
oldSort.call(this, cmp);
if (cmp) {
for (let i = 1; i < this.length; i++) {
if (cmp(this[i - 1], this[i]) === 0) {
let j = i + 1;
for (; j < this.length; j++) {
if (cmp(this[j - 1], this[j]) !== 0) {
break;
}
}
for (let x = i - 1, y = j - 1; x < y; x++, y--) {
const temp = this[x];
this[x] = this[y];
this[y] = temp;
}
i = j;
}
}
}
return this;
};
}