Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
codymikol
@codymikol
Sometimes it works and sometimes it doesn’t
So when it doesn’t I’ll see if that makes a difference
Shawn Rieger
@riegersn
N3RD L1F3
@N3RDL1F3WOB_twitter
Hello Karma Community, I have been trying to understand Karma and have a question. Hopefully someone can help.
What I would like to do is have Karma open a custom HTML Page that i created myself, within this page I will use code from an API. Now with jasmine I would like to run tests against the code on the HTML Page. Maybe im understanding karma wrong, but is this possible? I have installed the plugin karmaHTML and it seems to load the html page with the chrome launcher, it flashes the page than disappears. It seems the context to the JS from the api is gone that was on the page so I can not test on the page. Am I Missing something? Did I misunderstand how Karma/Jasmine is supposed to work? Any help would be greatly appriciated.
codymikol
@codymikol
@N3RDL1F3WOB_twitter if you're testing angularJS most of the time the elements you create are not actually put on the DOM so you don't see them. If you were to put them on document and debug you would see the result.
I don't recommend that though
because you'll need to clean that up
every time
Aubrey Quinn
@aubrey-fowler
Hi all, I want to write unit tests for my http requests. I want to connect to the real server and test the real responses. How do I get started?
N3RD L1F3
@N3RDL1F3WOB_twitter
@codymikol Thank you for answering! I am not testing angularJS we build our own API for clients. And we would like to test our API. I have a custom HTML file that i load into karma where all of our API calls/setup is integrated and the idea was to test against those calls/setup. If I am understanding correctly than I would need pretty much a blank page, than setup all of our calls per Karma?
codymikol
@codymikol
I would not use karma to test your API. What framework are you using for your API?
Jean-Philippe Déry
@jpdery
Hi. I'm currently working on a framework similar to react native / native script where some JS object are actually thin wrapper around a native object. From what I've seen, Karma looks like a pretty good solution to run unit test in a native JavaScriptCore context on ios or android but I can't seen to find any documentation about that (with make sense since this is very uncommon.) Does anyone know if this could really work (before I spend too much time figuring it out) ? Thanks
Jeffrey Lee
@jeffleeismyhero
In an Angular application, is it possible to globally mock a component for tests or do I need to override it in each spec individually?
Brad Richardson
@bradrich
Hello Karma devs! Are you guys aware of the set-value NPM vulnerability? There has been a fix released for set-value for the vulnerability in its version 3.0.1.
We are using v4.1.0 of Karma and we are seeing the set-value vulnerability being reported through npm audit.
Dale Francis
@dalefrancis88
Hey @bradrich i created an issue karma-runner/karma#3338 and although he was a bit of an ass about it, one of the devs has released a new version that looks to fix the issue
Joe Pea
@trusktr
Hello all! Anyone have a good Karma-Electron setup? Happy to share mine. I've got it running my TypeScript tests using karma-electron. I find it to be much better than Jest, because none of the DOM APIs are mocked (plus DOM APIs aren't missing like they are in Jest), and plus Node.js APIs are available too, so easy to test WebGL, Node servers, etc.
I got tired of Jest missing APIs, or for example trying to test some code that calls WebGL APIs and it simply doesn't work in Jest.
Why try to mock the DOM, when you can just test with real DOM? :)
Plus headless Electron runs great in Chrome OS, or on continuous integration setups.
And you can take snapshots of the pixels, for comparing to previous snapshots! Jest is quite lesser, just to give my opinion. :)
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)?