avajs / babel

Babel provider for AVA.
11 stars 3 forks source link

Enabling Babel as described in docs causes AVA 4 to exit with error #36

Closed scottdotweb closed 2 years ago

scottdotweb commented 2 years ago

The documentation tells you to enable Babel support like this:

"ava": {
    "babel": true
}

But it's out of date, that causes AVA 4 to exit with the error "Built-in Babel support has been removed."

What do we need to do? I tried this Babel configuration, but it didn't seem to help.

"env": {
    "test": {
        "plugins": [
            "rewire"
        ],
        "presets": [
            "@ava/babel/stage-4"
        ]
    }
}

My AVA config is simply:

"ava": {
    "files": [
        "test/**/*"
    ]
}
novemberborn commented 2 years ago

I've updated the README to reflect this only works with AVA 3.

I think using @babel/register is probably the way to go. I'll open an issue on AVA relating to the documentation there.

novemberborn commented 2 years ago

The problem has been the lack of contributions to this package, combined with improved ESM support in AVA 4 that the current version cannot make use of.

scottdotweb commented 2 years ago

Thanks @novemberborn. I did actually originally create this as an issue there, so I'll reopen it for your comments.