Debugging Redux Jest tests with node inspector

Viewed 217

I am trying to debug Redux Jest tests from the github repo https://github.com/reactjs/redux/blob/master/test with the node inspector.

node --inspect node_modules/jest/bin/jest.js --runInBand

import { bindActionCreators, createStore } from '../src'
import { todos } from './helpers/reducers'
import * as actionCreators from './helpers/actionCreators'

describe('bindActionCreators', () => {
  let store
  let actionCreatorFunctions

beforeEach(() => {
  debugger;
  store = createStore(todos)
  ...
  ...

However I am seeing the following error when placing an debugger statement within a test, as shown above.

FAIL  test/bindActionCreators.spec.js
 ● Test suite failed to run

/redux/test/bindActionCreators.spec.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){var _extends = Object.assign || function (target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i];for (var key in source) {if (Object.prototype.hasOwnProperty.call(source, key)) {target[key] = source[key];}}}return target;};import { bindActionCreators, createStore } from '../src';
                                                                                                                                                                                                                                                                                                                                                ^^^^^^

SyntaxError: Unexpected token import

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:305:17)
      at Generator.next (<anonymous>)
      at new Promise (<anonymous>)

I am running

  • node v8.9.1
  • jest v21.2.1
  • redux master branch

any ideas?

0 Answers
Related