Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
0 answers
61 views

I am getting error "TypeError: Cannot read properties of undefined (reading 'subscribe')". Below is the report.service.ts code saveReport(reportData: any, reportType: string, reportId: ...
1 vote
1 answer
287 views

I have a simple class called MyPresenter with a doOperation() method that calls one method on a View class that implements an interface and is passed in as a parameter. Here's the class, the interface ...
Jww's user avatar
  • 51
0 votes
1 answer
522 views

I am testing a typescript project with ts-mockito and jest. Getting errors like this on a function called execute: Error: 'MyAbstractClass.execute' is not a function // main.ts abstract class ...
2 votes
1 answer
219 views

I can't properly mock getConnection method from pool in mysql2 lib. My setup is next: "ts-mockito": "^2.6.1" "typescript": "^4.8.4" "mocha": "^10....
1 vote
1 answer
2k views

When I try to use mockito-ts to mock the return value of member functions on instances of mocked objects, I get that the member function is not a function. TypeError: Cannot read properties of null (...
1 vote
1 answer
724 views

Location is defined as follows: interface Location { ... search: string; ... } Let's say I have a service that looks like this: export class MyService { constructor(private readonly ...
1 vote
0 answers
470 views

I am trying to give the mock data in ClientProxy but I am keep on receiving null. It could be because of returning Observable. But I cannot figure it out how to properly mock the result. I am using ...
0 votes
1 answer
166 views

On entering a world of MEAN, I am also entering a world of promises. Now I got this problem: const promise = new Promise<Boolean>(() => {}); const testObject = mock(DB_DAO_object); when (...
0 votes
2 answers
846 views

Our project uses nestjs with mocha, chai and ts-mockito for testing and I can't figure out how to test a named nestjs Logger. new Logger() can be tested as expected: describe('basic test', () => { ...
0 votes
1 answer
2k views

I'm new to typescript and playing around with aws-lambda. I'm trying to unit test my handler so I need to mock the service class so it will return some mocked data Below I have a simple function that ...
4 votes
1 answer
857 views

i want to mock code inside a runTransaction function. example code: await admin.firestore().runTransaction(async transaction => { const hubDocument = admin.firestore().collection("Acme")...
1 vote
1 answer
641 views

Based on this question, I wrote this test: it('call service when search product by code', async() => { let code: string = 'CODE'; let product: Product = createProduct(); let properties: ...
1 vote
1 answer
168 views

I am using angular material stepper to navigate in my component have the below button: Below is my stepper.component.html code <button [disabled]="myService.disableNextButton(stepper....
-1 votes
1 answer
111 views

I get a 404 for unused and a 204 for used email from my API. Now i want to transform that to boolean (true/false) using rxjs/pipe and catchError. emailAvailable(): Observable<boolean> { return ...
1 vote
1 answer
796 views

I'm writing a unit test for a class which uses browser WebAPI interface. I use ts-mockito to mock the interface (a WebGL2RenderingContext in my case). When I run the test, Node throws ReferenceError: ...

15 30 50 per page
1
2 3

AltStyle によって変換されたページ (->オリジナル) /