Jest unable to detect Babel plugin during execution

As I venture into writing some Jest tests, an unexpected "unknown plugin" error has surfaced in my seemingly flawless Webpack/Babel setup that works perfectly during the npm run dev/npm run build phase.

The error message specifically states:

ReferenceError: Unknown plugin "@babel/transform-async-to-generator" specified in "C:\\Users\\scott\\path\\to\\ThisProject\\.babelrc" at 0, attempted to resolve relative to "C:\\Users\\scott\\path\\to\\ThisProject"

(The error is presented this way as I am using Git Bash on Windows.)

I have definitely installed

@babel/plugin-transform-async-to-generator
.

A snippet from my package.json:

"scripts": {
  "test": "jest",
  "build": "webpack --mode=production",
  "dev": "webpack --mode=development"
},
"jest": {
  "transform": {
    "^.+\\.jsx?$": "babel-jest"
  }
},
"dependencies": {
  "@babel/core": "^7.1.2",
  "@babel/plugin-transform-arrow-functions": "^7.0.0",
  "@babel/plugin-transform-async-to-generator": "^7.1.0",
  "@babel/plugin-transform-modules-commonjs": "^7.1.0",
  "@babel/plugin-transform-runtime": "^7.1.0",
  "@babel/polyfill": "^7.0.0",
  "@babel/preset-env": "^7.1.0",
  "babel-loader": "^8.0.4",
  "clean-webpack-plugin": "^0.1.19",
  "copy-webpack-plugin": "^4.5.2",
  "webpack": "^4.20.2",
  "webpack-cli": "^3.1.2"
},
"devDependencies": {
  "ajv": "^6.5.4",
  "babel-jest": "^23.6.0",
  "eslint": "^5.8.0",
  "jest": "^23.6.0",
  "jsdom": "^13.0.0",
}

My .babelrc file is quite straightforward:

{
    "presets": [
        [
            "@babel/preset-env",
            {
                "targets": {
                    "ie": "11"
                },
                "useBuiltIns": "entry"
            }
        ]
    ],
    "plugins": [
        "@babel/transform-async-to-generator",
        "@babel/transform-arrow-functions",
        "@babel/transform-modules-commonjs"
    ],
    "env": {
        "development": {},
        "test": {},
        "production": {}
    }
}

Similarly, jest.config.js is directly from jest --init:

module.exports = {
    clearMocks: true,
    coverageDirectory: "coverage",
    testEnvironment: "jsdom"
};

Any thoughts on what could be causing this issue?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is causing my axios request to not retrieve the correct data?

My axios instance is set up to connect to an API that has a login route. When I test the API using Postman, everything works perfectly and it returns JWT access and refresh tokens for valid credentials. However, when I try to login through my app using axi ...

Can an action be activated when the mouse comes to a halt?

Currently, I am having trouble triggering an event when a user stops moving their mouse over a div element. The current event is set up to show and follow another element along with the mouse movement, but I want it to only display when the mouse stops mov ...

Transfer selected option with various values using JavaScript from one list to another

Currently, I am experimenting with creating a Dual List Box for forms that involve multiple selections. This setup includes two lists: one containing options to choose from and the other displaying the selected options. My approach involves using vue2 alon ...

Guide to invoking a JavaScript function within a forEach loop

I'm currently working on customizing a plugin for including input tags, which can be found here Below is a simplified version of my problem. The plugin scans the page for any HTML elements with the 'tags-input' class and creates functions t ...

What is the best way to process an API call entirely on the server without revealing it to the client?

Seeking guidance on a technical issue I've encountered. On my website, x.com, a form submission triggers an API call to y.com, yielding a JS hash in return. The problem arises when Adblocker Plus intercepts the content from y.com, causing it to be bl ...

What could be causing the delay in $q.all(promises).then() not waiting for the promises to complete?

Currently, I am tasked with utilizing AngularJS 1.5.5. My task involves making calls to multiple Rest-Services and handling the results simultaneously. $scope.callWebservices = function(){ let promises = { first: callFirstWebservice(), ...

How to smoothly fade out content when hovering over a menu item in HTML<li> tags

Hi there, I have encountered a problem and could really use your assistance. I am attempting to create a menu that displays content when you hover over an li tag. The first content should always be visible when hovering over the first li option or if no l ...

I am unable to retrieve the local variable beyond the function

I'm having trouble accessing a local variable outside of a function even though I have initialized it before the function is called. <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jq ...

The feature in AngularJs where ng-options (key, value) is used with ng-model="selected" is not functioning properly

Here is the HTML code I am working with: <select ng-options="value.name for (key, value) in countries track by key" ng-model="selected" > </select> This is the specific object I am trying to manipulate: $scope.countries = { "AFG":{"name" ...

What is the method to activate/deactivate a button depending on a specified input value?

A simple application features an input field for a URL and a button. Upon clicking the button, the JavaScript code within it replaces the domain of the entered URL with a new domain. For instance, if a user enters "www.old.company.com/products," the appl ...

When the page is scrolled, the div is fixed in place and a class is dynamically added. Some issues may

Greetings everyone, I have a webpage with two floating divs - one is about 360px wide and the other has an auto width. As the page scrolls, the left div is assigned a class that fixes it to the screen, allowing the other div to scroll. This functionality w ...

Attempting to display items using the map method, pulling in text from an array

I am working with an array state that tracks the text entered by the user in a text field. My goal is to display this text within a component so users can see what they have previously entered. However, I am facing an issue with my Hashtags component when ...

Ways to expand the dimensions of a Popup while including text

I am using a bootstrap modal popup that contains a Treeview control in the body. The issue arises when the node's text width exceeds the popup's width, causing the text to overflow outside of the popup. Is there a way to dynamically adjust the ...

Saturn's Rings - beginning circumstances

Currently, I am developing a simulation of the Saturn system that will enable users to manipulate variables such as increasing the mass of its largest moon, Titan, to match that of Earth. This adjustment will illustrate how other moons and rings are affect ...

The feature of Access Control Request Headers involves appending certain information to the header of an AJAX request when using jQuery

Looking to enhance an AJAX POST request from jQuery with a custom header. Attempted solution: $.ajax({ type: 'POST', url: url, headers: { "My-First-Header":"first value", "My-Second-Header":"second value" } ...

Troubleshooting issue with TypeScript: Union types not functioning correctly when mapping object values

When it comes to mapping object values with all primitive types, the process is quite straightforward: type ObjectOf<T> = { [k: string]: T }; type MapObj<Obj extends ObjectOf<any>> = { [K in keyof Obj]: Obj[K] extends string ? Obj[K] : ...

Form submission caused by automatic loading of the page results in an endless loop

https://i.sstatic.net/cg5b3.jpgi'm currently implementing a Filter with the use of a Form. The desired functionality is that when a user lands on the list page, the form should automatically submit so that the user can view only the values they want t ...

Creating a dynamic event set feature with a Collada object in A-Frame for immersive webVR experiences

I've been experimenting with creating a rotating animation on a collada object using the event set component plugin for A-frame. While I've had success with a-box, I'm running into some issues when trying to animate the collada object instea ...

Retrieve content inside an iframe within the parent container

Hey there! I've been working on adding several iframes to my webpage. Each iframe contains only one value, and I'm trying to retrieve that value from the parent page. Despite exploring various solutions on Stack Overflow, none of them seem to be ...

Tips for excluding specific elements when clicking on a document

JavaScript $(document).click( function () { alert("Hello there"); } Web Development <div id="wrapper"> <div id="inner-1"> <div id="sub-inner1">Sub Inner1 Content</div> <div id="sub-inner2">Sub Inner2 Content&l ...