Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to version 3 leads to exception #44

Open
ChristianFinckler opened this issue Nov 28, 2017 · 3 comments
Open

Upgrading to version 3 leads to exception #44

ChristianFinckler opened this issue Nov 28, 2017 · 3 comments

Comments

@ChristianFinckler
Copy link

After upgrading browserify-istanbul from version 2.0.0 to version 3.0.1 I get the following exception during karma test execution:
TypeError: (options.instrumenter || require(...)).createInstrumenter is not a function
at transform (/home/cfinckle/lhotse-repos/sharing/node_modules/browserify-istanbul/index.js:42:83)
at module.exports (/home/cfinckle/lhotse-repos/sharing/node_modules/browserify-istanbul/index.js:23:12)
at nr (/home/cfinckle/lhotse-repos/sharing/node_modules/module-deps/index.js:301:23)
at onfile (/home/cfinckle/lhotse-repos/sharing/node_modules/resolve/lib/async.js:56:21)
at onex (/home/cfinckle/lhotse-repos/sharing/node_modules/resolve/lib/async.js:104:32)
at /home/cfinckle/lhotse-repos/sharing/node_modules/resolve/lib/async.js:24:24
at /home/cfinckle/lhotse-repos/sharing/node_modules/async-listener/glue.js:188:31
at FSReqWrap.oncomplete (fs.js:153:5)

I have the following main dependencies included:
"browserify": "14.5.0",
"browserify-istanbul": "3.0.1",
"isparta": "4.0.0",
"karma": "1.7.1",
"karma-browserify": "5.1.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.1",

I am using node 8.9.1.

Here is my karma config:
'use strict';

const isparta = require('isparta');
const os = require('os');

module.exports = (config) => {
const testJsAssetsDir = '../../test/client/';

config.set({
basePath: '',
frameworks: [
'browserify',
'jasmine-jquery',
'jasmine'
],
files: [
// fixtures
{
pattern: './fixture/**/*',
included: false
},
// globals
'https://develop.otto.de/static/global-resources/js/latest/testing/private_testing_min.js',
'https://develop.otto.de/static/global-pattern/js/latest/testing/private_testing_min.js',
// testUtil
${testJsAssetsDir}util/initUtil.js,
// specs
${testJsAssetsDir}js/**/*.test.js
],
exclude: [],
preprocessors: {
[${testJsAssetsDir}js/**/*.test.js]: ['browserify']
},
browserify: {
debug: true,
transform: [
[
'browserify-istanbul',
{
instrumenter: isparta
}
],
'babelify'
]
},
reporters: [
'kjhtml',
'mocha',
'coverage'
],
coverageReporter: {
type: 'lcov',
dir: '../../target/coverage/client'
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browserConsoleLogOptions: {
level: 'log',
terminal: true
},
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: false,
concurrency: os.cpus().length
});
};

Do you have an Idea, what causes the problem?

@AndrewLosikhin
Copy link

Same problem

@MatheusArleson
Copy link

Same problem here,

Node v6.11.3

"browserify": "14.5.0",
"browserify-istanbul": "3.0.1",
"browserify-ngannotate": "2.0.0",
"browserify-shim": "3.8.14",
"bulk-require": "1.0.1",
"isparta": "4.0.0",
"karma": "2.0.0",
"karma-browserify": "5.1.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.1",
"karma-ie-launcher": "1.0.0",
"karma-jasmine": "1.1.1",
"karma-phantomjs-launcher": "1.0.4",
"karma-sauce-launcher": "1.2.0",
"karma-spec-reporter": "0.0.32",
"merge-stream": "1.0.1",
"phantomjs-prebuilt": "2.1.16",

@alexindigo
Copy link
Collaborator

Hey, sorry for the late response. version 3 is meant to be used with https://npmjs.org/nyc as it's being the successor of istanbul.

And I don't have much experience with karma, to point out solution right away.

And it's good question for @bcoe what other test suites like Karma do, when istanbul library is not being updated.

PS. Also try to bump istanbul version within karma to 0.4.5 to see if it'd help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants