jasmine Questions
5
Solved
In our angular app, we use environment files to load some config.
environment.ts
export const environment = {
production: false,
defaultLocale: 'en_US',
};
We then use it in one of our servi...
5
Solved
Is it possible with Jest (Jasmine) to get the currently executed name of the test or describe inside the test?
Using Jasmine: How to get name of current test is not working anymore, at least with J...
2
Solved
I am trying to go for 100% test coverage, but i can't seem to test the stuff inside this onUploadFile function.
html template
<input type="file" formControlName="theUpload" i...
Teletypewriter asked 22/8, 2018 at 15:52
3
Solved
I'm new to Jasmine, and am getting this error:
Expected spy unknown to have been called.
What does this mean? I'm spying on a method, but am not sure what unknown means.
Hid asked 4/5, 2018 at 13:25
1
I installed vscode-test-explorer extension along with its child angular-karma-test-explorer and jasmine-test-adapter to vscode as answered here.
However, no tests are loaded to the Test Explorer, i...
Archaeozoic asked 16/10, 2019 at 9:57
10
Solved
I have run on my windows console:
npm install -g yo grunt-cli bower
npm install -g generator-angular
yo angular
Then I started my project with webstorm and did right click on the karma.conf.js...
Geriatrician asked 15/3, 2014 at 9:16
8
I have a very simple service call and a jasmine test for it.
Service call:
myServiceCall(testId: number) : void {
const url = `${this.url}/paramX/${testId}`;
this.http.put(url, {},{headers: th...
Oslo asked 8/6, 2018 at 7:53
5
Solved
I am using Jasmine (BDD Testing Framework for JavaScript) in my firefox add-on to test the functionality of my code.
The problem is that jasmine is outputing the test results to an HTML file,what...
Wacke asked 23/8, 2011 at 8:9
3
Solved
export interface User {
name: string;
}
How can I unit test the above interface, so Karma could show it in the code coverage report?
I already tried creating the object and assert some properti...
Reserve asked 18/4, 2018 at 18:53
12
Solved
I'm trying to write a test for the Jasmine Test Framework which expects an error. At the moment I'm using a Jasmine Node.js integration from GitHub.
In my Node.js module I have the following code:
...
Shackle asked 10/11, 2010 at 12:57
4
Solved
I have to test a function that uses the fromEvent observable function.
Before the upgrade to 'lettable' operators, I was just doing this:
spyOn(Observable, 'fromEvent').and.callFake(mockFromEven...
Eterne asked 24/1, 2018 at 11:3
2
I have a ExpressJs application and unit testing with was done using Jasmine. Currently I'm using real database to run unit tests as well. But I want to do unit testing without using the real databa...
Depose asked 12/2, 2020 at 4:55
7
Solved
I'm currently implementing 'unit testing' in my angular application. However, if I run them, I receive multiple warnings/errors similar to this one: 'Error retrieving icon: Unable to find icon with...
8
I am trying to run component testing on Angular web app using serenityJS + Jasmine but encountered the error below. Any idea how I can resolve this issue?
Message:
Error: zone-testing.js is needed...
Hodgkinson asked 6/5, 2021 at 8:13
2
I am a newbie to Jasmine and a bit confused between above two functions. My sole purpose is to give a fake implementation to a spy function. But, If I put debugger in callFake the it is getting cal...
Hollishollister asked 18/3, 2018 at 6:18
4
Solved
I created an Angular application under 4. I have migrated from version to version and am currently latest version 9. I was reviewing my tests. I have a Login component that I had 3 working tests an...
Pteridology asked 9/6, 2020 at 11:39
6
Solved
I want to unit test a directive that emulates a placeholder, where the input value is cleared only on keyup/down events.
Mayer asked 1/8, 2013 at 17:52
3
"Error: No provider for TranslateStore!" while UI Unit testing translation service in Angular 4.
After I run ng test command I get the test cases failed error along with the above error message.
Consolidation asked 6/12, 2017 at 10:58
5
If I have a variable setting to {} the following match errors
// Somewhere in my angular controller
self = this;
self.myVar = {};
// In my test file
// This errors out. I console.log myVar to ma...
Serpentiform asked 6/1, 2016 at 23:41
2
Angular using Jasmine and Karma getting - Incomplete: No specs found but converting spec.ts file to spec.js getting error Error during loading: Uncaught SyntaxError: Cannot use import statement out...
Rump asked 17/2, 2021 at 5:55
11
Solved
I'm trying to figure out on how to test internal (i.e. not exported) functions in nodejs (preferably with mocha or jasmine). And i have no idea!
Let say I have a module like that:
function export...
Specialistic asked 14/2, 2013 at 11:50
9
Solved
CREATE firstapp/package.json (1209 bytes)
CREATE firstapp/README.md (1018 bytes)
CREATE firstapp/tsconfig.json (783 bytes)
CREATE firstapp/tslint.json (3185 bytes)
CREATE firstapp/.editorconfig (27...
Gaye asked 10/5, 2021 at 0:44
5
In Angular 2.0.0, I am unit testing a component that uses Router. However I get the 'Supplied parameters do not match any signature of call target.' error. In Visual studio code in spec.ts it is th...
Nectarous asked 30/9, 2016 at 12:41
10
Solved
I'm using Jasmine and have a library js file with lots of functions which are not associated with any object (i.e. are global). How do I go about spying on these functions?
I tried using window/doc...
Aceldama asked 1/3, 2012 at 3:17
2
Solved
I have a particular function that I am trying to test using Angular. This function returns a promise. Although in my test I set expectations for the promise result, Jasmine does not wait for the pr...
© 2022 - 2024 — McMap. All rights reserved.