Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Jest compatibility? #52

@bkonkle

Description

@bkonkle

Hi! Thanks for sharing this project! I'm trying to use it with Jest, and running into trouble:

myproject-consumer-portal feature/test-architecture ✗ 3h26m △ ➜ yarn test
yarn test v0.24.6
$ jest
 FAIL  src/modules/client/ducks/flow/reducers.spec.js
  ● Test suite failed to run

    /Users/brandon/code/myproject-consumer-portal/src/modules/client/ducks/flow/reducers.spec.js: Unexpected token import

      at createScript (vm.js:53:10)
      at Object.runInThisContext (vm.js:95:10)
      at Module._compile (module.js:543:28)
      at Object.Module._extensions..js (module.js:580:10)
      at Module.load (module.js:488:32)
      at tryModuleLoad (module.js:447:12)
      at Function.Module._load (module.js:439:3)
      at Module.require (module.js:498:17)
      at require (internal/module.js:20:19)
      at PluginPass.CallExpression (node_modules/babel-plugin-webpack-alias/build/index.js:39:28)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        1.607s
Ran all test suites.
error Command failed with exit code 1.

I'm digging into the source trying to figure out how to work around it, but I don't have any good leads yet. If anyone has ideas, I'd love to hear them! :-)

My .babelrc:

{
	"presets": ["react", "es2015", "stage-1"],
	"plugins": [
		"add-module-exports",
		"jsx-display-if",
		"transform-class-properties",
		"transform-object-rest-spread",
		[ "babel-plugin-webpack-alias", { "config": "./tools/webpack/webpack.resolve.babel.js", "findConfig": true } ],
		"styletron-react"
	]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions