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

Jasmine Uncaught ReferenceError: jasmineRequire is not defined #69

Open
sashokbg opened this issue Jul 21, 2022 · 0 comments
Open

Jasmine Uncaught ReferenceError: jasmineRequire is not defined #69

sashokbg opened this issue Jul 21, 2022 · 0 comments

Comments

@sashokbg
Copy link

Hello,

I am trying to make karma-commonjs work with jasmine and I get the following error on a very basic example:

Uncaught ReferenceError: jasmineRequire is not defined
  at node_modules/karma-jasmine/lib/boot.js:14:17
  
  ReferenceError: jasmineRequire is not defined
      at node_modules/karma-jasmine/lib/boot.js:14:17
      at window.__cjs_module__./home/alexander/projects/karma-test/node_modules/karma-jasmine/lib/boot.js (node_modules/karma-jasmine/lib/boot.js:43:2)
      at runModule (node_modules/karma-commonjs/client/commonjs_bridge.js:40:5)
      at require (node_modules/karma-commonjs/client/commonjs_bridge.js:79:14)
      at node_modules/karma-commonjs/client/commonjs_bridge.js:141:13
      at node_modules/karma-commonjs/client/commonjs_bridge.js:145:3

Here is my karma.config.js

module.exports = function (config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
    frameworks: ['commonjs', 'jasmine'],


    // list of files / patterns to load in the browser
    files: [
      {pattern: 'lib/**/*.js', included: false},
      {pattern: 'src/**/*.js', included: false},
      {pattern: 'test/**/*spec.js', included: false}
    ],

    // preprocess matching files before serving them to the browser
    // available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
    preprocessors: {
      '**/*.js': ['commonjs']
    },

    browsers: ['ChromeHeadless'],
  })
}

Any help is greatly appreciated.
Thank you
Regards Alex

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

1 participant