I've moved a load of helper methods into a npm published library, but some of them are being mocked in the unit tests and I can't figure out how to mock the new
I know how to unit test with 3rd party dependencies by extending the class with your own protocol so that you can inject a mock dependency that implements that
My Repository layer is returning list object, But in my service layer i am filtering out all other and return a single Object. when i try to create test cases i
This is how I wrote the code to start a test with the unittest module but it is returning as 0 tests. Is the return making any problems? (I am able to share the
I have just set up my project to use H2DatabaseTestResource in the tests. I also have created a custom PostgresDatabaseTestResource, following this brilliant bl
I'm trying to use __mocks__. src/shared/state/use-some-state.ts export const useSomeState = () => { return { value: 6 }; } which is exported from an index
I wrote some nodejs codes to be evaluated by a particular test file, candidate.test.js but surprisingly the test keeps failing. Below is the error I am getting:
I would like some assistance in resolving this error. Am using Jest V28.0.0. Here's how my package.json's test script & devDependencies look like "scri
I am stuck since long as it is kind of difficult to mock DB calls in unit testing in Nextjs. I have used @prisma/client for database communication. I have studi
I have a angular class implemented ControlValueAccessor interface too. I need to have 100% coverage. Please help me to cover the remain. Line 20, 35, 36 need to
using nestjs framework and with a repository class that uses mongoose to do the CRUD operations we have a simple users.repository.ts file like this: @Injectable
I'm not sure why this is so difficult to get going, but I'm new to Python and I'm trying to get any unit test framework to run tests, but if I test a file that
I'm new in Go and unit test. In my project am using Go with gorm and connecting mysql database. my queries is how to unit test my code: My code is below(main.go
I have an issue in my tests that flag up a window variable as undefined. But I don't know where in the setupTests.tsx, I would need to define it. So far the var
After updating to React 18 or creating a new React 18 app from create-react-app, when I run the yarn test command, it gives a console.error as a Warning for eac
How can I test a Timer inside a Bloc, using blocTest? I’m using the bloc library, with freezed to build the state and event objects (might not matter here
Let us assume that the next feature that I have to develop is to store some data on a database. Following the TDD paradigm, I have to first write a failing test
I'm trying to write a Java unit test but not sure where I'm going wrong. Likely a lack of understanding. This is my test so far: @Test public void getURL() thro
Amazon has a super useful article describing how to unit test AWS SDK Go v2. I understand their motivation to depart from the "old" way of unit testing the v1
I'm creating an integration test for a Web API, so I'm starting an entire application in a unit test using WebHost.CreateDefaultBuilder() and the usual setup bi