Skip to content

Commit aba4a44

Browse files
committed
Remove support for the AVA 3.0 provider protocol
1 parent 4d3e220 commit aba4a44

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

lib/globs.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
normalizePattern,
1313
normalizePatterns
1414
} from './glob-helpers.cjs';
15-
import providerManager from './provider-manager.js';
1615

1716
export {
1817
classify,
@@ -69,10 +68,8 @@ export function normalizeGlobs({extensions, files: filePatterns, ignoredByWatche
6968

7069
ignoredByWatcherPatterns = ignoredByWatcherPatterns ? [...defaultIgnoredByWatcherPatterns, ...normalizePatterns(ignoredByWatcherPatterns)] : [...defaultIgnoredByWatcherPatterns];
7170

72-
for (const {level, main} of providers) {
73-
if (level >= providerManager.levels.pathRewrites) {
74-
({filePatterns, ignoredByWatcherPatterns} = main.updateGlobs({filePatterns, ignoredByWatcherPatterns}));
75-
}
71+
for (const {main} of providers) {
72+
({filePatterns, ignoredByWatcherPatterns} = main.updateGlobs({filePatterns, ignoredByWatcherPatterns}));
7673
}
7774

7875
return {extensions, filePatterns, ignoredByWatcherPatterns};

lib/provider-manager.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@ import * as globs from './globs.js';
22
import pkg from './pkg.cjs';
33

44
const levels = {
5-
ava3: 1,
6-
pathRewrites: 2
5+
// As the protocol changes, comparing levels by integer allows AVA to be
6+
// compatible with different versions. Currently there is only one supported
7+
// version, so this is effectively unused. The infrastructure is retained for
8+
// future use.
9+
levelIntegersAreCurrentlyUnused: 0
710
};
811

912
const levelsByProtocol = {
10-
'ava-3': levels.ava3,
11-
'ava-3.2': levels.pathRewrites
13+
'ava-3.2': levels.levelIntegersAreCurrentlyUnused
1214
};
1315

1416
async function load(providerModule, projectDir) {

lib/watcher.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import flatten from 'lodash/flatten.js';
77

88
import {chalk} from './chalk.js';
99
import {applyTestFileFilter, classify, getChokidarIgnorePatterns} from './globs.js';
10-
import providerManager from './provider-manager.js';
1110

1211
let chokidar = chokidar_;
1312
export function _testOnlyReplaceChokidar(replacement) {
@@ -99,7 +98,7 @@ export default class Watcher {
9998

10099
const patternFilters = filter.map(({pattern}) => pattern);
101100

102-
this.providers = providers.filter(({level}) => level >= providerManager.levels.pathRewrites);
101+
this.providers = providers;
103102
this.run = (specificFiles = [], updateSnapshots = false) => {
104103
const clearLogOnNextRun = this.clearLogOnNextRun && this.runVector > 0;
105104
if (this.runVector > 0) {

0 commit comments

Comments
 (0)