import React from "react";import shenable from "enzyme";import App from "./App";it("App", () => const application = shallow(App />); expect(1).toEqual(1););The loved one component it"s picking up is :

import React, Component from "react";import render from "react-dom";// import "./styles/normalize.css";class App exhas a tendency Component render() rerevolve ( div>appdiv> ); render(App />, document.getElementById("app"));However, running jest causes a failure:

Invariant Violation: _registerComponent(...): Target container is not a DOM element.

With errors

at Object. (src/App.js:14:48)at Object. (src/App.test.js:4:38)

The test documents recommendations line 4, which is the import of , that causes a fail. The stack map says line 14 of App.js is the reason for the faiattract -- which is nothing more than the render speak to from react-dom, something I"ve never had a difficulty via (the app provides appropriately from my Webpack setup).

For those interested (Webfill code):

module.exports = entry: "./src/App", output: filename: "bundle.js", path: "./dist" , module: loaders: < test: /.js?$/, exclude: /node_modules/, loader: "babel", query: presets: <"react", "es2015"> , test: /.css$/, loader: "style!css-loader?modules&importLoaders=1&localIdentName=_____" , test: /.scss$/, loader: "style!css-loader?modules&importLoaders=1&localIdentName=_____!sass" > And my package.json:

"name": "tic-tac-dux", "version": "1.0.0", "description": "", "main": "index.js", "scripts": "dev": "webpack-dev-server --devtool eval --development --colors --inline --hot --content-base dist/", "test": "jest" , "jest": "moduleNameMapper": aac , "keywords": <>, "author": "", "license": "ISC", "devDependencies": "babel-core": "^6.17.0", "babel-jest": "^16.0.0", "babel-loader": "^6.2.5", "babel-polyfill": "^6.16.0", "babel-preset-es2015": "^6.16.0", "babel-preset-react": "^6.16.0", "css-loader": "^0.25.0", "enzyme": "^2.4.1", "jest": "^16.0.1", "jest-cli": "^16.0.1", "node-sass": "^3.10.1", "react-addons-test-utils": "^15.3.2", "react-dom": "^15.3.2", "sass-loader": "^4.0.2", "style-loader": "^0.13.1", "webpack": "^1.13.2", "webpack-dev-server": "^1.16.2" , "dependencies": "react": "^15.3.2", "react-dom": "^15.3.2" Oh, and also if anyone is going to say that the div aspect isn"t being loaded before the script, here"s my index.html: