Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ed Spencer
@efjspencer_twitter
Hi Karma kids! I've just migrated from Karma 1.7 to 4.2. I've got the suite running, but now I oddly get inconsistent test runs. Totally different tests will fail on one run, and then pass on another. I've gone through the docs an wound the concurrency down to 1, but that hasn't helped. I was wondering if anyone had any suggestions?
Dale Francis
@dalefrancis88
That sounds like some kind of shared global state issue
Ed Spencer
@efjspencer_twitter
I was thinking that, which is why I wound the concurrency down to 1!
It's a largeish suite. We've got 2.5k tests
Dale Francis
@dalefrancis88
aren't all tests still executed within the same global context? concurrency is about how many tests run at the same time
Ed Spencer
@efjspencer_twitter
I was thinking the concurrency would stop the tests interfering with each other via that global context, if they were
Dale Francis
@dalefrancis88
i can't say for sure, but i'd be surprised if that's the case. You'd be re-initilizing the entire context for every one of your 2.5k tests
Ed Spencer
@efjspencer_twitter
hmm
ok
Dale Francis
@dalefrancis88
all kards on the table, i'm not a karma expert by any means, it just looks like a shared state issue. I wonder though if their is something in the change logs you could check that might tell you if something critical changed between versions
Brent Douglas
@BrentDouglas
Hello all. I am having an issue in my karma tests where one of my javascript files in the files section doesn't get loaded in the browser. Has anyone run into something like this before?
Brent Douglas
@BrentDouglas
I upgraded karma and that fixed it
Aubrey Quinn
@aubrey-fowler
Hi all, is it possible to write HTTP integration tests with AngularJS 1.5? Karma & Jasmine
Fernando Costa
@fadc80
Is possible to preprocess karma/jasmine test files (*.spec.ts) to add path information as described here: karma-runner/karma#2699?
I'm trying to do so, but despite seeing my preprocessor is called and that it really changes spec files content, karma still runs the original version of the file.
Joe Pea
@trusktr
@aubrey-fowler I think it is possible. You can use web tech like XMLHttpRequest() or fetch() in any web-based testing environment, and place that code inside of your tests.
@fadc80 Wish I knew about that topic. Can't help there, sorry!
Fernando Costa
@fadc80
Okay @aubrey-fowler Thank you for your interest.
I did some updates on karma-runner/karma#2699. Could somebody confirm if my conclusion is correct?
Diego Molina
@diemol
Hi all,
I'm trying to reach to the maintainers of https://github.com/karma-runner/karma-sauce-launcher, is any of them here in this room?
We have a PR open since a while ago and we'd love some feedback.
karma-runner/karma-sauce-launcher#164
Kyle Hoehns
@kylehoehns
Curious if anyone else has ran into this issue. We have about 2,100 tests and a while back we started noticing a random number of tests being ran during our CI builds. One run will be 700 tests and the next will be a separate set of 500 or 1000. Is there a way I can debug to see what files karma is grabbing and why only a subset of them are getting processed on a given run? We noticed this around the time our CI server updated from Chrome 75 to 76 but I'm not sure if that's making a difference.
Kyle Hoehns
@kylehoehns
Looks like it may be related to this karma-runner/karma#3352 .
raghanag
@raghanag
Hi All, I have the karma runner setup and it is giving and uncaught exception and failing without any erros i am using typescript
Karma-typescript for preprocessor
is there anything wrong in my tsconfig
Ilya Goncharov
@ilia_goncharov_twitter
Hello, is karma-teamcity-reporter is not supported already? And there are no plans to update it (including Pull Requests)?
magendirang
@magendirang
Hello All, I am working on an Angular 7.0.2 and I am using karma Jasmine for the unit tests. I have close to 3500 tests and it is being split into execute in 4 shards ChromeHeadless. One of the shards is always failing and rarely all 4 shards execution completes. The error I get does not give much information about what is wrong. Any help is really appreciated! 15:59:08 HeadlessChrome 0.0.0 (Linux 0.0.0) ERROR
15:59:08 {
15:59:08 "message": "An error was thrown in afterAll\n[object ErrorEvent] thrown",
15:59:08 "str": "An error was thrown in afterAll\n[object ErrorEvent] thrown"
15:59:08 }
15:59:08 HeadlessChrome 0.0.0 (Linux 0.0.0): Executed 65 of 921 (skipped 8) ERROR (44.243 secs / 44.164 secs)
magendirang
@magendirang
@lwensveen Hey I am running into the same error. Could you please share what you did to fix?
Zalezale
@Zalezale
where is the karma api doc
I want to know the meaning of “describle,it....”
Joe Pea
@trusktr
@Zalezale You're looking for either Jasmine, or Mocha.js + Chai.js. One of those provides the descript/it API. Karma itself doesnt provide that API, it only runs your tests.
SandeepNS12
@SandeepNS12
@Zalezale karma is just a task runner which runs your test cases
Joe Pea
@trusktr
Yep, and you can install karma-jasmine, for example, to get the describe/it APIs, but you don't necessarily have to install Jasmine specifically. 👉 https://jasmine.github.io
Zalezale
@Zalezale
but ,why karma can know api like describle,it if it do not contain the api
Joe Pea
@trusktr
I don't think it does. Maybe you have karma-jasmine or karma-chai installed (or something else).
You can run npm ls karma-chai or npm ls karma-jasmine to see if they are installed in your project.
Maybe you followed some tutorial, or maybe some default steps you followed automatically add karma-jasmine?
Zalezale
@Zalezale
yes ,you are right bro
I find the karma-chai at package.json
in fact i just want to find the doc intro the api like it ,describle, thanks
thank you very much
Joe Pea
@trusktr
no prob. In that case https://www.chaijs.com should help out.
kumaraswamyarun
@kumaraswamyarun
I was using jest for testing react components, but jest would not render c3 js or svg elements since it uses jsdom and jsdom is basic only, so I am switching to Karma, since it would run in browser although I am planning to run it in headless browser like phantom js, I think the charts will render using karma, am I correct in this?
kumaraswamyarun
@kumaraswamyarun
yes its working, since using chrome
Joe Pea
@trusktr
@kumaraswamyarun Yep! Hence why I use Karma too (I use karma-electron so that I have both Node.js and Chrome APIs available for tests)
meenanarendra
@meenanarendra
Hi All
How are you doing
I am looking for a solution to unit test javascript of a ASP .NET MVC website. I used Karma, Jasmine and RequireJs but getting error while running test cases