Skip to content

Commit

Permalink
Gate behind nonSemVerExperiments
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Sep 25, 2023
1 parent 9296944 commit 7b0c55b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export default async function loadCli() { // eslint-disable-line complexity
});
}

if (combined.observeRun) {
if (combined.observeRun && experiments.observeRunsFromConfig) {
combined.observeRun({
events: asyncEventIteratorFromApi(api),
});
Expand Down
2 changes: 1 addition & 1 deletion lib/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {packageConfig, packageJsonPath} from 'pkg-conf';

const NO_SUCH_FILE = Symbol('no ava.config.js file');
const MISSING_DEFAULT_EXPORT = Symbol('missing default export');
const EXPERIMENTS = new Set();
const EXPERIMENTS = new Set(['observeRunsFromConfig']);

const importConfig = async ({configFile, fileForErrorMessage}) => {
const {default: config = MISSING_DEFAULT_EXPORT} = await import(url.pathToFileURL(configFile));
Expand Down
3 changes: 3 additions & 0 deletions test/internal-events/fixtures/ava.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export default {
files: [
'test.js',
],
nonSemVerExperiments: {
observeRunsFromConfig: true,
},
async observeRun(run) {
for await (const event of run.events) {
internalEvents.push(event);
Expand Down

0 comments on commit 7b0c55b

Please sign in to comment.