Skip to content
This repository was archived by the owner on Jul 4, 2018. It is now read-only.
This repository was archived by the owner on Jul 4, 2018. It is now read-only.

cannot compile ES6 files properly when it's used as preLoaders of Webpack in Karma #23

@kmCha

Description

@kmCha

this is a part of my karma.conf.js:

        preLoaders: [
          {
            test: /\.js$/,
            loader: 'isparta',
            include: path.resolve(__dirname, './src/'),
            query: {
              babel: {
                presets: ['es2015', 'stage-0', 'react']
              }
            }
          }
        ]

then i run test using karma, it said:

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Error: Cannot find module "../../src/components/userfeedback"
  at /Users/kM/Web/ali-baichuan/baichuan-console-static/test/components/userfeedback-test.js:55 <- webpack:///test/components/userfeedback-test.js:3:0

and this is a part of my userfeedback-test.js:

import UserFeedback from '../../src/components/userfeedback';

the interesting thing is that, when i use isparta-instrumenter-loader, which is deprecated, the test runs successfully. Following is a part of my new karma.conf.js:

        preLoaders: [
          {
            test: /\.js$/,
            loader: 'isparta-instrumenter',
            include: path.resolve(__dirname, './src/'),
            query: {
              babel: {
                presets: ['es2015', 'stage-0', 'react']
              }
            }
          }
        ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions