Skip to content

Support ava.config.mjs files #2346

Closed
@novemberborn

Description

@novemberborn

AVA recognizes ava.config.mjs files but refuses to load them. Let's fix this!

See the code here:

throw new Error(`AVA cannot yet load ${fileForErrorMessage} files`);

Of course import() is only available on Node.js 13. This should fail gracefully on Node.js 10 and 12.

import() is asynchronous. The loadConfig() method should still return synchronously when loading other files.

The documentation needs to be updated to explain when .mjs config files make sense and when users should use .cjs or .js files. Mostly this is to do with ESLint compatibility (since rules must currently be synchronous).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions