require.config TypeError: undefined is not a function

1k views Asked by At

I want to write some tests with Jasmine. Therefore I first want to load RequireJS. Thus I put a reference in the Jasmine.json file:

{
  "spec_dir": "spec",
  "spec_files": [
    "**/*[sS]pec.js"
  ],
  "helpers": [
    "helpers/**/*.js",
    "../node_modules/requirejs/require.js",
    "../public/js/app/config/config.js"
  ]
}

The config file starts with this:

require.config({...

When I start Jasmine it gives this error:

require.config({ ^

TypeError: undefined is not a function at Object. (C:\Users\Garrarufa\Documents\WebstormWorkspace\website3\public\js\app\config\co nfig.js:4:9)

at Module._compile (module.js:460:26)

at Object.Module._extensions..js (module.js:478:10)

at Module.load (module.js:355:32)

at Function.Module._load (module.js:310:12)

at Module.require (module.js:365:17)

at require (module.js:384:17)

at C:\Users\Garrarufa\AppData\Roaming\npm\node_modules\jasmine\lib\jasmine.js:69:5

at Array.forEach (native)

at Jasmine.loadHelpers (C:\Users\Garrarufa\AppData\Roaming\npm\node_modules\jasmine\lib\jasmine.js:68: 20)

config is undefined, but why?

0

There are 0 answers