Skip to main content
0 votes
1 answer
301 views

I don't seem to find a solution for the below code / test to work (I went through a lot of articles and stackOverflow...). Various solutions provided by chatGPT are useless as well. I also see people ...
GiedreA's user avatar
  • 11
-1 votes
1 answer
288 views

In my console, I see this: console.log 27 (>$-1 not safe, so NOT) buying 0.6573442493668066 XBTUSD at 62777 with leverage none to close at 63718.7 as 1747062777 My test code says: await bot....
Dave Scotese's user avatar
0 votes
1 answer
954 views

I'm new in using Karma and unit tests in Angular and I'm struggling... I have a method I want to test when the service I'm using is returning a bad request The method is this._commandService....
Christèle Legeard's user avatar
1 vote
1 answer
124 views

In my Angular project, all the Rest services are defined like below, they have 4 signatures public commandsGet(oem: string, countryCode?: string, observe?: 'body', reportProgress?: boolean): ...
Christèle Legeard's user avatar
1 vote
0 answers
89 views

I have a function (functionUnderTest) that calls another function (functionToTest). Both return an observable. I want to test if the function functionToTest is called when functionUnderTest is called. ...
Be Br's user avatar
  • 61
0 votes
1 answer
53 views

I have some code similar to this: class A { f1() { } } function f2() { const a = new A(); a.f1(); } test('test1', async () => { const spy_f1 = jest.spyOn(A.prototype, "f1")...
carlo.milanesi's user avatar
0 votes
1 answer
323 views

I'm using Jasmine to test this class X{ test(obj){ return obj.someFunction()+100 } } so my spec is it("test if someFunction is called and return value calculated correctly",()=>{...
Sarl sbeer's user avatar
0 votes
0 answers
44 views

Here's my component: export class QrcodeComponent implements OnInit { constructor( private qrGenService: QrGeneratorService, ) { } private draw(): void { this.setOptions(); this....
Sasha  Kalash's user avatar
1 vote
2 answers
1k views

When I just run my individual test it works. When I run the whole file I get this error. Let's say I have an entity called Group, Group has properties and methods. I'm trying to verify that these ...
Paulo Santana's user avatar
1 vote
1 answer
1k views

Not sure how I can mock a side-effect function with Vitest in Typescript Node.js project, Vitest 0.33.0. Consider this simplified example: // dummy.ts export function parent(): string { return `foo${...
Igor's user avatar
  • 1,231
3 votes
0 answers
1k views

How can you test if a method is called inside the onmount in vue with script setup. The problem is that there is documentation that is done with option api where in the test I can call the component ...
Deivis Rodriguez's user avatar
1 vote
1 answer
1k views

I'm fairly new to Jasmine so excuse my silly question. I'm trying to override the value of the spy only for one it block and I'm hitting issues. I'm seeing ERROR: <spyOn> : ActionsEnabled has ...
TechnoCorner's user avatar
  • 5,205
5 votes
1 answer
4k views

I would like to use `vi.spyOn` to monitor the call to an sideEffect function in a module to make sure is being called by another function in a module. I did this on jest without problems but it does ...
micurs's user avatar
  • 543
0 votes
1 answer
944 views

I wonder why the last assert (expect(msgSpy).toBeCalled()) in this example fails. What do I need to change to make it pass? it('spyOn test', () => { const newClient = () => { const ...
Faber's user avatar
  • 1,592
0 votes
1 answer
268 views

In my test case, I am trying use spyon and call the dialog, but it still says 'Statement not covered' in the coverage report in the line where we are opening the dialog(this._dialog.open(...
user1015388's user avatar
  • 1,543

15 30 50 per page
1
2 3 4 5
9