question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"config.files.map is not a function" when passing --files option

See original GitHub issue

Hi, It seems I am unable to instruct Karma to only run a particular file.

Is this not possible anymore (I saw a reference to this having been possible on Stack Overflow)?

$ karma run karma.conf.js --files=new Array\("tests/unit/frontend/specs/timeLeftSpec.js"\)

[2015-11-30 10:20:50.784] [DEBUG] config - Loading config /Users/vs/Kod/myproject/karma.conf.js
/Users/vs/Kod/myproject/node_modules/karma/lib/config.js:107
  config.files = config.files.map(createPatternObject).map(createPatternMapper(basePathResolve));
                              ^

TypeError: config.files.map is not a function
    at normalizeConfig (/Users/vs/Kod/myproject/node_modules/karma/lib/config.js:107:31)
    at Object.parseConfig (/Users/vs/Kod/myproject/node_modules/karma/lib/config.js:293:10)
    at Object.exports.run (/Users/vs/Kod/myproject/node_modules/karma/lib/runner.js:30:16)
    at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/karma/bin/karma:22:39)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:117:18)

I imagine using this for allowing my IDE (PhpStorm) to run the Karma test for a file (in the IDE) whenever a test/implementation file changes.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

50reactions
joallardcommented, Jul 27, 2016

Banging my head on the wall for a few hours of this now, I don’t get why karma needs to be this user-hostile to running a single test. Makes TDD a true pain edit: excruciating.

13reactions
dignifiedquirecommented, Nov 25, 2016

Banging my head on the wall for a few hours of this now, I don’t get why karma needs to be this user-hostile to running a single test. Makes TDD a true pain edit: excruciating.

Comments like this are pretty maintainer-hostile. So if you need this so badly why not create a good PR with tests to solve the issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

data.map is not a function - Stack Overflow
The answer is to use data.products.map , not to wrap data in an array. Your answer causes the entire data object to be...
Read more >
TypeError: map() is not a function in React | bobbyhadz
The "TypeError: map is not a function" occurs when we call the map() method on a value that is not an array. To...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
Python developer reference for Azure Functions
json: Contains configuration options that affect all functions in a function app instance. This file does get published to Azure. Not all ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found