Skip to main content

All Questions

Tagged with
-1 votes
0 answers
32 views

How to mock a method call which is private and static? [closed]

TestThisMethod is the class and command Store is the method invoked from useCommandStore. I want to mock commandStore which is private and static, when and then of JUnit is not working here. Class ...
Henry Passion's user avatar
3 votes
2 answers
76 views

Can you test whether a function is actually running Asynchronously?

I'm working on a ASP.NET Web Api project to learn the framework and the testing for it and I was wondering if you could test that Asynchronous methods are actually running Asynchronously (or are they ...
White Head Ice Prince's user avatar
-2 votes
0 answers
46 views

How to test a server action function?

I have a nextjs server action that uses mssql for node to connect with the database. The following is pizza.actions.ts: export async function get_pizza_id(pizza_name: string) { try { if(!...
Sid's user avatar
  • 37
1 vote
1 answer
55 views

How to unit test for multipart.Form

I need to write tests for that function: func Parse(f *multipart.Form) ([]Person, error) It's important to say, that multipart.Form.Value is not just key:value, thats more complicated json, simple ...
kirin's user avatar
  • 31
1 vote
1 answer
75 views

TS2305: Module '@angular/core/testing' has no exported member async

I updated angular version from 17 to 18 and because of which some modules are no longer supporter especially in spec.ts files while importing them. Like async from @angular/core/testing and **...
Nixon Darius's user avatar
1 vote
2 answers
38 views

How can I write a test with Xunit that accepts an enum as parameter?

I try to write a test that looks like this: private static readonly IEnumerable<MyEnumType> ListOfEnumValues = Enum.GetValues(typeof(MyEnumType)).Cast<DocumentType>(); private static ...
MrMaavin's user avatar
  • 1,719
0 votes
1 answer
20 views

Can I use built-in Microsoft DI in unit tests for init objects?

in unit tests for init and create the objects I would like to use buit-in Microsoft DI, is it good practice?
Ershad Raoufi's user avatar
0 votes
0 answers
8 views

Testing on Loom testnet

I try to deploy it on Loom testnet: truffle.js test --network loom_testnet **This is my configtion Loom testnet in config-truffle.js : ** enter image description here AND THIS IS I GOT THIS ERROR ...
 Kim Thuy FX17597's user avatar
1 vote
0 answers
28 views

Nested ViewChilds in Angular component, unit testing

I have a parent component, where in my template i have button : <button actions data-cy="appointment-creation-calendar" *ngIf="tabIndex === 1" [...
Alan Dolan's user avatar
-1 votes
0 answers
14 views

Is it wrong to use a node module package directly in unit tests instead of mocking them

I'm using vitest to write some unit tests in my react app, and I've been wondering why we don't just use the node_module packages when necessary directly instead of mocking them? I have included the ...
Sajjad Ostadebrahim's user avatar
-1 votes
0 answers
49 views

Debug doesnt starting when trying to debug dotnet test using neovim and neotest

When I set a breakpoint on the test and try to run it in the debugger, nothing happens, the indicator just blinks as if it is running, and after 450 seconds an error appears that the file could not be ...
Vlad's user avatar
  • 1
1 vote
0 answers
46 views

Test suite failed to run ReferenceError: TextEncoder is not defined

I am trying to test my project using a mock API instead of a real one to save money. However, when I add the following code to my setupTests.js file: // setupTests.js import { server } from "./...
Ali Asghar Gill's user avatar
0 votes
1 answer
39 views

MockMvc test always returns 200 regardless of JWT authorities

@Test public void testGetOrders() throws Exception { mockMvc.perform(get("/admin/api/orders/") .with(jwt().authorities(new SimpleGrantedAuthority("...
TheClassicSmoke's user avatar
1 vote
1 answer
54 views

How to unit test logic under AG GRID gridApi function forEachNode

Trying to get my unit test coverage for this bit of code: processUpdates(input) { let request = []; this.gridApi.forEachNode(function (node) { // <--- How to mock/spy inside forEachNode ...
null-point-exceptional's user avatar
0 votes
0 answers
30 views

ABAP detailed log of unit tests

The objective will be to be able to generate a document with a more detailed restitution of the tests carried out than what the framework offers; with input data, result data and an explanatory ...
depth1's user avatar
  • 135

15 30 50 per page
1
2 3 4 5
443