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

Karma v2.0.3 TypeError: Cannot read property 'markCaptured' of undefined #3052

Closed
Havunen opened this issue Jun 18, 2018 · 7 comments
Closed

Comments

@Havunen
Copy link

Havunen commented Jun 18, 2018

When you start running tests using Karma 2.0.3 and clear the url during tests. To start from clean point. Karma fails to Javascript error

Expected behaviour

Karma should start from beginning

Actual behaviour

Karma crashes and browser closes

Environment Details

Windows 10,
NodeJS 10.3.0
Chrome 67.0.3396 + Chrome-launcher

Steps to reproduce the behaviour

  1. Start tests
  2. Wait tests finish
  3. Clear URL ( localhost:9876 )
    4 Karma crashes

Callstack

18 06 2018 09:34:11.079:ERROR [karma]: TypeError: Cannot read property 'markCaptured' of undefined
    at Launcher.markCaptured (C:\GIT\SeveraUI\node_modules\karma\lib\launcher.js:176:13)
    at Server.on (C:\GIT\SeveraUI\node_modules\karma\lib\server.js:179:16)
    at Server.emit (events.js:182:13)
    at Browser.init (C:\GIT\SeveraUI\node_modules\karma\lib\browser.js:54:18)
    at Socket.socket.on (C:\GIT\SeveraUI\node_modules\karma\lib\server.js:235:22)
    at Socket.emit (events.js:182:13)
    at C:\GIT\SeveraUI\node_modules\socket.io\lib\socket.js:513:12
    at process._tickCallback (internal/process/next_tick.js:61:11)
(node:14320) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

Edit: This works in Karma 2.0.2

@Havunen
Copy link
Author

Havunen commented Jun 18, 2018

Just noticed that this PR might be related, but its not released:

#3047

@jackrvaughan
Copy link

Also seeing this issue

@aamirmukaram
Copy link

Update your package.json and it will work

"karma": "~2.0.3",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.4.3",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",

@johnjbarton
Copy link
Contributor

Updating the package.json in this way should not fix this issue. Install 2.0.2 if this blocks you.

@jnizet
Copy link

jnizet commented Jun 19, 2018

I also see this behavior happen when simply opening a new browser and going to http://localhost:9876:

  • run tests and let karma start chrome with the chrome launcher: everything is fine
  • enter http://localhost:9876 in another browser navbar (firefox for example) to check if the tests pass in Firefox -> karma crashes

jnizet added a commit to Ninja-Squad/globe42 that referenced this issue Jun 19, 2018
cexbrayat pushed a commit to Ninja-Squad/globe42 that referenced this issue Jun 19, 2018
@LastBeel
Copy link

Hi, I am having this issue too. Is there any npm command to revert install or install older version of karma or is the best solution to revert the commit?

@johnjbarton
Copy link
Contributor

Fixed by #3047

frederickfogerty added a commit to imgix/react-imgix that referenced this issue Jun 24, 2018
frederickfogerty added a commit to imgix/react-imgix that referenced this issue Jun 26, 2018
* test: configure jest to just run unit tests

* test: add file to wrap integration tests into one file

* test: break out setup files into one for each test target

* test: add karma configuration for local, headless chrome, and browserstack

* test: add npm scripts for integration tests and dependencies

* test: add webpack config for test bundling

* WIP

* test: update npm configuration to use browserstack and karma on ci, and limit browsers to 1 for testing purposes

* test: tidy up karma config and add mocha reporter

* test: update mobile browserstack config

* test: fix typo in karma config

* test: add firefox to local launchers and update tests

* test: add safari to local testing when on a Mac

* test: bump karma due to karma-runner/karma#3052

* chore: only initialise jest-extended for unit tests for now

* test: update karma config to handle os x safari versions correctly.

* test: remove karma concurrency level

* test: reduce number of browsers to test

* test: try use iPhone 8 rather than iPhone X

* test: disable iPhone support

* docs: add docs for integration testing

* docs: update browserstack instructions to include a build tag

* test: update default integration test
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

6 participants