@jest/test-sequencer
Advanced tools
Comparing version 27.5.1 to 28.0.0-alpha.0
@@ -7,7 +7,10 @@ /** | ||
*/ | ||
import type { AggregatedResult, Test } from '@jest/test-result'; | ||
import type { Context } from 'jest-runtime'; | ||
declare type Cache = { | ||
[key: string]: [0 | 1, number]; | ||
import type {AggregatedResult} from '@jest/test-result'; | ||
import type {Context} from 'jest-runtime'; | ||
import type {Test} from '@jest/test-result'; | ||
declare type Cache_2 = { | ||
[key: string]: [0 | 1, number]; | ||
}; | ||
/** | ||
@@ -26,28 +29,30 @@ * The TestSequencer will ultimately decide which tests should run first. | ||
*/ | ||
export default class TestSequencer { | ||
private _cache; | ||
_getCachePath(context: Context): string; | ||
_getCache(test: Test): Cache; | ||
/** | ||
* Sorting tests is very important because it has a great impact on the | ||
* user-perceived responsiveness and speed of the test run. | ||
* | ||
* If such information is on cache, tests are sorted based on: | ||
* -> Has it failed during the last run ? | ||
* Since it's important to provide the most expected feedback as quickly | ||
* as possible. | ||
* -> How long it took to run ? | ||
* Because running long tests first is an effort to minimize worker idle | ||
* time at the end of a long test run. | ||
* And if that information is not available they are sorted based on file size | ||
* since big test files usually take longer to complete. | ||
* | ||
* Note that a possible improvement would be to analyse other information | ||
* from the file other than its size. | ||
* | ||
*/ | ||
sort(tests: Array<Test>): Array<Test>; | ||
allFailedTests(tests: Array<Test>): Array<Test>; | ||
cacheResults(tests: Array<Test>, results: AggregatedResult): void; | ||
declare class TestSequencer { | ||
private _cache; | ||
_getCachePath(context: Context): string; | ||
_getCache(test: Test): Cache_2; | ||
/** | ||
* Sorting tests is very important because it has a great impact on the | ||
* user-perceived responsiveness and speed of the test run. | ||
* | ||
* If such information is on cache, tests are sorted based on: | ||
* -> Has it failed during the last run ? | ||
* Since it's important to provide the most expected feedback as quickly | ||
* as possible. | ||
* -> How long it took to run ? | ||
* Because running long tests first is an effort to minimize worker idle | ||
* time at the end of a long test run. | ||
* And if that information is not available they are sorted based on file size | ||
* since big test files usually take longer to complete. | ||
* | ||
* Note that a possible improvement would be to analyse other information | ||
* from the file other than its size. | ||
* | ||
*/ | ||
sort(tests: Array<Test>): Array<Test>; | ||
allFailedTests(tests: Array<Test>): Array<Test>; | ||
cacheResults(tests: Array<Test>, results: AggregatedResult): void; | ||
} | ||
export default TestSequencer; | ||
export {}; |
@@ -74,16 +74,8 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
const FAIL = 0; | ||
@@ -106,5 +98,3 @@ const SUCCESS = 1; | ||
class TestSequencer { | ||
constructor() { | ||
_defineProperty(this, '_cache', new Map()); | ||
} | ||
_cache = new Map(); | ||
@@ -111,0 +101,0 @@ _getCachePath(context) { |
{ | ||
"name": "@jest/test-sequencer", | ||
"version": "27.5.1", | ||
"version": "28.0.0-alpha.0", | ||
"repository": { | ||
@@ -20,6 +20,6 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/test-result": "^27.5.1", | ||
"@jest/test-result": "^28.0.0-alpha.0", | ||
"graceful-fs": "^4.2.9", | ||
"jest-haste-map": "^27.5.1", | ||
"jest-runtime": "^27.5.1" | ||
"jest-haste-map": "^28.0.0-alpha.0", | ||
"jest-runtime": "^28.0.0-alpha.0" | ||
}, | ||
@@ -30,3 +30,3 @@ "devDependencies": { | ||
"engines": { | ||
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" | ||
"node": "^12.13.0 || ^14.15.0 || ^16.13.0 || >=17.0.0" | ||
}, | ||
@@ -36,3 +36,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850" | ||
"gitHead": "89275b08977065d98e42ad71fcf223f4ad169f09" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10437
243
2
+ Added@jest/console@28.1.3(transitive)
+ Added@jest/environment@28.1.3(transitive)
+ Added@jest/expect@28.1.3(transitive)
+ Added@jest/expect-utils@28.1.3(transitive)
+ Added@jest/fake-timers@28.1.3(transitive)
+ Added@jest/globals@28.1.3(transitive)
+ Added@jest/schemas@28.1.3(transitive)
+ Added@jest/source-map@28.1.2(transitive)
+ Added@jest/test-result@28.1.3(transitive)
+ Added@jest/transform@28.1.3(transitive)
+ Added@jest/types@28.1.3(transitive)
+ Added@sinclair/typebox@0.24.51(transitive)
+ Added@sinonjs/fake-timers@9.1.2(transitive)
+ Added@types/yargs@17.0.32(transitive)
+ Addeddiff-sequences@28.1.1(transitive)
+ Addedexpect@28.1.3(transitive)
+ Addedjest-diff@28.1.3(transitive)
+ Addedjest-get-type@28.0.2(transitive)
+ Addedjest-haste-map@28.1.3(transitive)
+ Addedjest-matcher-utils@28.1.3(transitive)
+ Addedjest-message-util@28.1.3(transitive)
+ Addedjest-mock@28.1.3(transitive)
+ Addedjest-regex-util@28.0.2(transitive)
+ Addedjest-resolve@28.1.3(transitive)
+ Addedjest-runtime@28.1.3(transitive)
+ Addedjest-snapshot@28.1.3(transitive)
+ Addedjest-util@28.1.3(transitive)
+ Addedjest-validate@28.1.3(transitive)
+ Addedjest-worker@28.1.3(transitive)
+ Addedpretty-format@28.1.3(transitive)
+ Addedreact-is@18.3.1(transitive)
+ Addedwrite-file-atomic@4.0.2(transitive)
- Removed@jest/console@27.5.1(transitive)
- Removed@jest/environment@27.5.1(transitive)
- Removed@jest/fake-timers@27.5.1(transitive)
- Removed@jest/globals@27.5.1(transitive)
- Removed@jest/source-map@27.5.1(transitive)
- Removed@jest/test-result@27.5.1(transitive)
- Removed@jest/transform@27.5.1(transitive)
- Removed@jest/types@27.5.1(transitive)
- Removed@sinonjs/fake-timers@8.1.0(transitive)
- Removed@types/yargs@16.0.9(transitive)
- Removeddiff-sequences@27.5.1(transitive)
- Removedexpect@27.5.1(transitive)
- Removedis-typedarray@1.0.0(transitive)
- Removedjest-diff@27.5.1(transitive)
- Removedjest-get-type@27.5.1(transitive)
- Removedjest-haste-map@27.5.1(transitive)
- Removedjest-matcher-utils@27.5.1(transitive)
- Removedjest-message-util@27.5.1(transitive)
- Removedjest-mock@27.5.1(transitive)
- Removedjest-regex-util@27.5.1(transitive)
- Removedjest-resolve@27.5.1(transitive)
- Removedjest-runtime@27.5.1(transitive)
- Removedjest-serializer@27.5.1(transitive)
- Removedjest-snapshot@27.5.1(transitive)
- Removedjest-util@27.5.1(transitive)
- Removedjest-validate@27.5.1(transitive)
- Removedjest-worker@27.5.1(transitive)
- Removedpretty-format@27.5.1(transitive)
- Removedreact-is@17.0.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedtypedarray-to-buffer@3.1.5(transitive)
- Removedwrite-file-atomic@3.0.3(transitive)
Updatedjest-runtime@^28.0.0-alpha.0