Skip to main content

All Questions

Tagged with
0 votes
0 answers
18 views

ParameterizedTest JUNIT5 with suspend functions

I'm trying to clean a little bit my code and when testing my datasource I'm repeating a lot the test that returns connection and service error, and I'd like to have a bunch of code that tests ...
StuartDTO's user avatar
  • 881
0 votes
0 answers
29 views

Django Internationalization test error:Couldn't retrieve redirection page

I wrote a blog project in Django,in some pages i used loginrequierdmixin to make sure user is loged in but in test i got error test: def test_get_profile_unauthenticated(self): response = ...
ParsaM's user avatar
  • 1
0 votes
0 answers
12 views

Testing provider in flutter which depends on Firebase

I am trying the following test: @GenerateMocks([Tour]) void main() { group('TripProvider', () { test('add Trip', () async { final mockTrip = MockTour(); TripProvider provider = ...
Arnob's user avatar
  • 507
0 votes
1 answer
28 views

How to test Amazon Athena queries

I have a rather complicated Athena query, which I would like to test on a local machine without connecting to Athena. I specified some mock data for testing purposes, and I was hoping that I could use ...
Amuoeba's user avatar
  • 714
1 vote
1 answer
52 views

How can I test that the PHP code under test calls the proper method on a trait?

Edit: After reading one of the comments, I realized I misspoke pretty badly in the original post, I've made some edits to clarify. Essentially, I need to check the results but am struggling with that ...
jrgilman's user avatar
  • 472
-1 votes
1 answer
30 views

XCode tests issue: 'any Protocol' does not conform to expected type 'Protocol' insert 'as! Protocol'

Started adding tests to supplementary objects Tested class code: class TokenAdapter { private let tokenProvider: TokenProviderProtocol! private let session: SessionProtocol! // MARK: - Init ...
Viktor's user avatar
  • 1,107
0 votes
1 answer
27 views

Testing Value Objects in DDD, "Implementing Domain Driven Design"

In the book "Implementing Domain Driven Design" of Vaughn Vernon, in the Testing of Value Objects section, the author talks about how we can use just shallow copy instead of deep copy to ...
Khoa Phạm's user avatar
-3 votes
1 answer
38 views

Go: test fails when expected value is the same as got value [closed]

I'm learning to test http endpoints in Go with the httptest library and my test is failingeven though by the result it should pass. The function being tested: func testHandler(w http.ResponseWriter, r ...
Anacardo's user avatar
3 votes
2 answers
80 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
-1 votes
0 answers
76 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
  • 47
1 vote
1 answer
59 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
117 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
48 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
21 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
9 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
30 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 vote
0 answers
68 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
41 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
70 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
1 vote
0 answers
36 views

How to create more 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
  • 145
-1 votes
1 answer
27 views

Flask unit test failing due to FileNotFoundError for private key file [duplicate]

I'm trying to run unit tests on a Flask application that utilizes public and private keys for JWT token generation. However, when running my unit tests, I'm getting a FileNotFoundError indicating that ...
KauaKing's user avatar
1 vote
2 answers
43 views

Run JUnit tests from multiple projects at once

I have a repository of projects, each containing JUnit tests. I am looking for either a method or a framework to run them all at once, instead of manually running for each project. After some research ...
Arseni's user avatar
  • 11
0 votes
0 answers
27 views

How to identify the best method to test a function in Android Studio?

Below is a function in our Android application designed to update the app with a new installation of its current version. However, each approach I've attempted has encountered significant obstacles, ...
user25102566's user avatar
0 votes
0 answers
50 views

Test that a Dart stream does not emit anything, without listening to it

I am currently working on a Flutter app, but my question is solely related to Dart. I need to implement a repository which exposes an outbound stream of data. This repository's responsibility is to ...
Pierre Massé's user avatar
0 votes
1 answer
46 views

Mock patching an endpoint unittest that makes several requests to third party

I have a single endpoint written using django ninja. This endpoint executes a crawler that performs several requests. The sequence of requests has 3 different routines depending on whether or not the ...
Gustavo Costa's user avatar
0 votes
0 answers
42 views

Python unittest how to mock function which external function is defined in __init__.py

I would like to test my_func2 that is calling my_func1. I would like to mock my_func1, but I don't know how can I do it when my_func2 is imported in my_package.__init__.py. When I delete that import, ...
sceptre's user avatar
0 votes
0 answers
20 views

Error when trying to add BA-DUA in project

This is my first time with BA-DUA, and online there isn't so much to learn about (at least where I searched). I wanted to add this tool for data-flow testing coverge in my project. I added this in my ...
LuX's user avatar
  • 65
0 votes
0 answers
47 views

How to run cypress component tests from storybook play function

I'd like to run cypress component tests from storybook play button. Is it possible? Example: export const Default: Story = { play: async ({ canvasElement }) => { cy.mount(canvasElement); ...
  MalcoreHardcore698's user avatar
0 votes
0 answers
26 views

How I can test location service, and it's permissions with junit?

Is it possible to write to write instrumental tests and later on for location permissions? I'm relatively new to testing topic, and I haven't found much examples that could possibly help me with it.
SmierdzoncaRobotaEhhh's user avatar
1 vote
0 answers
42 views

How can I skip/disable running of unittests in rustc bootstrap build testing?

I am running rustc bootstrap build tests via the commandline: python3 src/bootstrap/bootstrap.py test --exclude "some excluded test cases list" --no-fail-fast --bless --target x86_64-poky-...
Yashinde's user avatar
0 votes
1 answer
58 views

when() requires an argument, Mockito and BCrypt

I'm trying to make an unit test in a project, but i'm stuck at trying to mock the BCrypt.checkpw function, i've read that making a static mock requires a certain way to handle the test, i'm not ...
Axel Fernando Castro Jimenez's user avatar
0 votes
0 answers
43 views

Testing frameworks and best practices for LLM testing

I am developing a GenAI-enabled matching solution where I send two lists of objects ith many features each to an LLM and ask to match them based on semantic similarity. I want to implement automated ...
Oskar de Smet's user avatar
0 votes
2 answers
25 views

How to mock and perform asserts in MessageBox

I'm making a desktop/on-premise application using C# .Net Windows Forms and I need to perform some tests on a class that interacts with the user through messages while carrying out some processes, and ...
williamqmoura's user avatar
1 vote
2 answers
35 views

How do unit tests work in test-driven development?

I've been thinking a lot about unit tests today and I got a bit puzzled as to how exactly unit tests are created during the test-driven development (TDD) process. (To be clear, a unit test for me is ...
helloworld123's user avatar
0 votes
2 answers
36 views

Compared to every other type of test, why are unit tests valued so highly? [closed]

I am struggling to understand why unit tests are valued so highly in the coding community. If I look at any other type of test (e.g. feature, integration, TIP), I think any of them carry infinitely ...
helloworld123's user avatar
-1 votes
1 answer
14 views

Can't spyOn second & third call jest

I can't do spyOn on the second and third calls of a function in a test with jest I tried to do it like this by following the documentation : it("should succeed after retry on first attempt ...
Gabriel's user avatar
  • 21
0 votes
0 answers
27 views

How can I create a unit test for a memory dump without mocking?

In Javascript, I have these two functions: const promiseMemoryDump = async (address1, address2, outputFile) => { if (getPlatform() === 'linux') { await promiseExec(`memdump -s ${address1} -...
KeeperOfTheSevenKeys's user avatar
0 votes
0 answers
19 views

How to test and to what extend should I write unit tests?

I am new to unit testing, and currently working on a new release of one of my packages to be testable. Currently, I am struggling to see when and what to test. Take the following script for reference: ...
Andres Eloy's user avatar
0 votes
0 answers
56 views

How to test navigation to page in MAUI?

I have a simple navigation service : public class NavigationService(INavigation navigation) : INavigationService { public INavigation Navigation { get; } = navigation; public void ...
infinitesimal's user avatar
0 votes
0 answers
28 views

writing test for the upload image and get image methods in spring boot

I am working on a Spring Boot project. One of the features of the project is the ability to upload image and get image using APIs. this is my UserServiceImpl: package com.example.firsttask.service....
Erfan's user avatar
  • 1
-1 votes
1 answer
129 views

How do you test react-aria-components for the custom props you passed in?

The components render fine on a live local server and everythign works fine. But I can't figure out how to test the components for the react-aria-library. I know they are already tested by the ...
Domas's user avatar
  • 1
0 votes
1 answer
59 views

pytest fixtures in nested Classes

I have written the following testcase using pytest. import pytest data_arg = ["arg1", "arg2"] class TestParentClass1: @pytest.fixture(scope="class", params=data_arg,...
Shreyansh Jain's user avatar
0 votes
0 answers
17 views

Writing a test method for an async service layer method

I have a repository layer that does a few CRUD operations. I want to write unit tests for the methods in this class to make sure they work as expected etc. Here is my repository layer: using Microsoft....
Andy Orchard's user avatar
0 votes
1 answer
42 views

Asserting attribute change after transaction, using Foundry test network

Context I am trying to test whether a function receiveInvestment() external payable { that receives currency from a wallet address private _investorWallet; changes the uint256 private _someStoredValue;...
a.t.'s user avatar
  • 2,584
0 votes
0 answers
57 views

How to mock web3 method call

How would one mock this call to a ethereum smart contract using the web3 js library. export const getERC20Balance = async ( web3Client: Web3, tokenAddress: string, walletAddress: string ) => {...
Umer's user avatar
  • 1
0 votes
0 answers
92 views

How to implement threshold for JUnit tests

I have Junit tests which is invoked by a test class which is called TestRunner and look like this: @TestInstance(Lifecycle.PER_CLASS) class TestRunner { @ParameterizedTest(name = "{index} {0}...
Antonia Banderas's user avatar
1 vote
1 answer
49 views

Increasing test coverage for files I didn't write

I have written a python program that calculates various statistical values of a given list of integers and the range of values. Now, I am trying to write a test file for the program that can achieve &...
Austin's user avatar
  • 51
-1 votes
1 answer
181 views

Testing Pinia store with setup syntax - how to mock computed fields?

Anyone have idea how can I test Pinia store with @pinia/testing and vitest if I made store with setup syntax. When I use createTestingPinia, I am able to mock computed fields, but actions calls could ...
Ika's user avatar
  • 9
0 votes
0 answers
20 views

Testing flow of multiple Camunda workflows in a single test case

There are 5 camunda workflows all perform the same operations and have excatly the same behaviour except the names of the workflow. workflow 1 workflow 2 workflow 3 workflow 4 workflow 5 what i want ...
DIVYANSH SIDDHARTH's user avatar
0 votes
0 answers
34 views

My Coverage Tool in Intellij is giving me weird results

I have been trying to do a Coverage Test on my Scala code and it doesn't seem to want to work correctly My Code: case class Play( customerId: String, forename: String,...
Hayden McKenzie's user avatar

15 30 50 per page
1
2 3 4 5
133