Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ignoring a resolved configuration #3334

Open
tommy-mitchell opened this issue Jul 22, 2024 · 1 comment
Open

Allow ignoring a resolved configuration #3334

tommy-mitchell opened this issue Jul 22, 2024 · 1 comment
Labels

Comments

@tommy-mitchell
Copy link
Contributor

tommy-mitchell commented Jul 22, 2024

Feature Request

AVA should support a way to ignore a resolved configuration, for example a (mono-)repo's ava.config.js.

Possible solutions:

  • Have configurations in a directory take precedence over a parent configuration (e.g. "ava" field in a package.json and a root ava.config.json)
  • Add a root: boolean option to configs that specifies not to search for parent configurations
  • Add a CLI flag to ignore parent configurations (e.g. npx ava --ignore-parent-configs)
  • If the resolved configuration contains the current test in its "ignores", skip it

Rationale

I'm trying to update the examples to AVA 6 (#2993), but they resolve the repo's ava.config.js when trying to run them:

…/examples/endpoint-testing
$ npx ava
  ⚠ Using configuration from …/ava.config.js

  ✘ Couldn’t find any files to test

$ npx ava test.js
  ⚠ Using configuration from …/ava.config.js

  ✔ get /user
  ─

  1 tests passed

The TypeScript examples have a custom config:

// package.json
"ava": {
    "typescript": {
        "compile": "tsc",
        "rewritePaths": {
            "source/": "build/"
        }
    }
}

This results in the tests failing due to conflicting configs:

…/examples/typescript-basic
$ npx ava

  ✘ Conflicting configuration in ../../ava.config.js and package.json

Attempting to ignore the examples in ava.config.js doesn't work:

- files: ['test/**', '!test/**/{fixtures,helpers}/**', ...skipWatchMode],
+ files: ['test/**', '!test/**/{fixtures,helpers}/**', '!examples', ...skipWatchMode],
@novemberborn
Copy link
Member

Should the TypeScript examples switch to an ava.config.js file instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants