Skip to main content
Filter by
Sorted by
Tagged with
Best practices
3 votes
0 replies
36 views

Let's say I have Worker class and I want to do long running tasks in the background until user stops it or it is cancelled. It changes state of the class while doing the work and I want to write tests ...
Domz's user avatar
  • 11
Best practices
0 votes
0 replies
49 views

I’m currently working on a personal Android project using Kotlin and Android Studio, following a basic MVVM architecture: ─main │ ├───java │ │ └───com │ │ └───example │ │ └───...
alex_pythooon's user avatar
Best practices
0 votes
2 replies
42 views

Goal How can I use pydantic_settings in pytest? I want to have a .env.test environment file that has dummy values for all the environment variables. Some code has logic that depends on those variables ...
trey hannam's user avatar
1 vote
0 answers
53 views

The test with coverage runs perfectly well locally: C:\xyz\DevOps\xyz.DependencyInjection [master ≡]> dotnet test -c:Release --no-build -f net9.0 --filter "FullyQualifiedName~Tests....
mark's user avatar
  • 63.6k
0 votes
2 answers
58 views

I am trying to test the number of times a Flow is collected - runTest { var count = 0 backgroundScope.launch(UnconfinedTestDispatcher(testScheduler)) { dao.getEntities().collect { ...
jL4's user avatar
  • 1,242
0 votes
1 answer
70 views

I am running DBT models on Databricks and I am starting to implement unit tests for them. I have the following DBT unit test : unit_tests: - name: test_my_model model: my_model given: ...
Nakeuh's user avatar
  • 1,933
-1 votes
0 answers
44 views

This is my parent component. import { useState } from 'react'; import VButton from 'ui-components/src/v2/VButton.jsx'; import { Provider } from 'ui-components/src/v2/providers/chakra.jsx'; import { ...
dariusz's user avatar
  • 593
1 vote
0 answers
24 views

When writing Ginkgo unit tests, I ran into an issue asserting data received from a channel that contains a struct with an interface{} field. Here's my models.go type WsBaseMsg struct { Type ...
CyberCr0w's user avatar
1 vote
1 answer
55 views

Running this unit test in Angular 21 always fails with the following error: × should toggle showSettings when settings button is clicked (440231 ms) ● DrawerComponent › should launch settings ...
bob.mazzo's user avatar
  • 5,789
2 votes
3 answers
119 views

I have three processor classes that share a common interface for polymorphic behavior using std::variant and std::visit. Each processor has a processData() member function that internally consists of ...
Ali Sedighi's user avatar
0 votes
1 answer
52 views

The following code is a simplification of the code that I have and may not disclose: class Logger { var _loggingStarted = false; void startLogging() { if (!_loggingStarted) { ...
user31112632's user avatar
Best practices
1 vote
2 replies
168 views

I am part of a team that is developing a general-purpose, Python-based 3D mesh viewer using the VTK (Python) library. Read about VTK here: https://docs.vtk.org/en/latest/getting_started Our Python ...
xblz's user avatar
  • 40
0 votes
1 answer
57 views

Take the following Mongoose schema. const userSchema = mongoose.Schema({ username: { type: String, required: true, unique: true, minLength: 3 }, name: ...
Ahmad's user avatar
  • 10
2 votes
3 answers
160 views

I want to build make test with Makefile, and the test target should generate <file_name>_test executable based on the folder tests/<file_name>.c. All tests/*.c files have a main() function....
stackbiz's user avatar
  • 1,914
1 vote
2 answers
148 views

I have a problem which I find awfully hard to debug: In my application, I currently have about 1000 tests, so not much. They are split across several directories (tests/someDir, tests/someOtherDir, ...
PhilippG's user avatar
1 vote
1 answer
88 views

I am trying to get a unit test to work using Mockito 5.14.2. The method I am trying to unit test is a static method (m1). Within the same class Myclass1 there is another static method (m2) which ...
Oxnard's user avatar
  • 418
0 votes
1 answer
84 views

I'm taking a course using the pycharm learn feature and can't get past a unit test, I think it's saying that it can't find it in the correct spot. How do I fix this? Error: Traceback (most recent call ...
ColdCosmicSoup's user avatar
5 votes
0 answers
229 views

I have a solution with many projects. When I run dotnet test, it selects all my xUnit projects and seems to correctly execute all of them. But at the last line of what dotnet test prints, the number ...
FluidMechanics Potential Flows's user avatar
1 vote
1 answer
103 views

It is my understanding that you have to @ExtendWith(MockitoExtension.class) to run a test class with Mockito runner. And to use TestFX to test a JavaFX application you would need to @ExtendWith(...
tM_za's user avatar
  • 11
2 votes
1 answer
118 views

I'm organizing my tests using JUnit 5's @Suite and @SelectClasses, but need to control the execution sequence of the test classes. According to the documentation, @SelectClasses doesn't guarantee ...
Abhiram Reddy Milkuri's user avatar
1 vote
1 answer
110 views

I'm working on a user-related service that handles personal information. While writing unit tests with Mockito, I ran into dependency issues with Byte Buddy, which prevented me from using the latest ...
Apurva Agarwal's user avatar
0 votes
2 answers
97 views

I have a function that allows users to register. After successful registration, the user is redirected to the home page (after 5 seconds). Before being redirected, the user receives a toast ...
Clyde's user avatar
  • 62
3 votes
2 answers
156 views

I am creating a test to verify an object is passed to a method then verifying that the params match to the method in the call I am testing. The problem I am having that the object I am verifying ...
James Andrew Smith's user avatar
0 votes
1 answer
52 views

I am struggling adding mocked methods when testing a Pinia store's functionality. There is very little documentation relating to actually testing the stores themselves, as most Pinia's official ...
Vampuuri's user avatar
2 votes
2 answers
108 views

I am attempting to test a repository method using a moq with a setup in the test. As far as I can tell, this is not testing the method but only testing the test. Here is an abbreviated version of the ...
Jesse Liberty's user avatar
0 votes
0 answers
60 views

I'm using Laravel 12 along with Pest (using Mockery), and I have this method : public function destroy(array $ids): array { $data= Item::findAllByFieldIn('id', $ids)->get(); // ...
naspy971's user avatar
  • 1,411
1 vote
1 answer
61 views

I provide a generic provider for Json serialization: public interface IJsonSerializerProvider { T? Deserialize<T>(string value); string Serialize(object? obj); object? ...
user2843511's user avatar
1 vote
2 answers
139 views

In creating unit tests for an r package that provides a custom ggplot2 theme, I've noticed that the snapshots created by vdiffr::expect_doppelganger() aren't reflecting font family changes that work ...
mac's user avatar
  • 3,794
1 vote
1 answer
73 views

In Rails Controller tests of an invalid route, this used to work before Rails-7.1 (in Minitest): assert_raises(ActionController::RoutingError){ get "/non_existent" } In Rails-7.1 (or later),...
Masa Sakano's user avatar
  • 2,309
0 votes
1 answer
34 views

I'm trying to compile a very simple kotlin test file based off of the example at https://kotlinlang.org/docs/jvm-test-using-junit.html#create-a-test in order to prove that my setup in bazel is ...
jxramos's user avatar
  • 8,454
-1 votes
1 answer
69 views

In a large Vue 3 app, we have some helper modules that are imported into various components. One of these helpers returns the root node, which itself contains many other methods. In the app calls to ...
danwellman's user avatar
  • 9,401
1 vote
0 answers
64 views

I am building a card game using Godot 4.5, with C#. I am trying to unit test a Card object that inherits from Node2D, but when I attempt to run the test, I get the following exception: Exception has ...
tbric123's user avatar
0 votes
2 answers
111 views

I have a beginner Python program that generates random output and does not take any input. For example, it simulates rolling a dice 5 times and prints the results, their sum, and average: import ...
userfh's user avatar
  • 49
0 votes
0 answers
58 views

I would like to ask about a certain topic that is tough one. Im working in a project that has microservices architecture with more than 1 databases running every time. in django, how can I perform ...
1 vote
2 answers
126 views

I have a class that looks like this: public int DoWork(int value) { return value + GetDataFromDB(); } public int GetDataFromDB() { return 10; } In the real world the second function goes ...
John's user avatar
  • 306
0 votes
0 answers
32 views

Our project currently has two types of tests: Tests that communicate with the MySQL test database and tests that don't. The database tests should be run in sequence as they mutate the same database, ...
GSerum_'s user avatar
  • 113
0 votes
0 answers
56 views

Lets say we have the following interface: public interface IGetRandomString { void Init(); bool IsInited { get; } //returns random string of length chars string GetRandomString(int ...
bairog's user avatar
  • 3,539
0 votes
0 answers
80 views

I'm using point free's swift snapshot testing for capturing images of SwiftUI views. It works well so far, but when I use SwiftUI's FocusState I get a different output on CI compared to my local ...
Lukas Würzburger's user avatar
1 vote
1 answer
100 views

My data-driven Boost test-case takes several parameters. I chose to group them in a std::tuple. So the resulting dataset consists in a list of tuples. Beyond a 1-element tuple (test1 below), the ...
Francois's user avatar
  • 2,086
1 vote
1 answer
99 views

I am working with ASP.NET/.NET 4.8 application. My action method is as follows: public class TestController: System.Web.Http.ApiController { // pseudo code public async Task<...
Nitin S's user avatar
  • 7,713
0 votes
0 answers
36 views

I'm using NSubstitute to mock the creation of a HttpClient when calling IHttpClientFactory.CreateClient() in an ASP.NET Core 8 Web API. The code is as follows: httpClientFactory = Substitute.For<...
Rokke's user avatar
  • 63
1 vote
1 answer
552 views

private readonly IMapper _mapper; public CreateDepartmentRequestHandlerTests() { var config = new MapperConfiguration(cfg => cfg.AddProfile(new CreateDepartmentProfile())); _mapper = ...
Saidabror's user avatar
0 votes
2 answers
98 views

I have a C++ file which defines multiple Catch2 unit tests. Some of these unit tests call code which uses SPDLOG_TRACE. By default trace level logs are not shown. What options are available to enable ...
user2138149's user avatar
  • 18.7k
0 votes
1 answer
134 views

I have written a C++ Unit Test which has a design problem. The test is relatively straightforward. I am testing some kind of "iobuffer" object. There is a function recv which is used to copy ...
user2138149's user avatar
  • 18.7k
1 vote
1 answer
55 views

Question I have a registerUser method that imports a hashPassword function from a local utility module. // registerUser.ts import { User } from "../models/user.model"; import { hashPassword }...
Rugved J's user avatar
1 vote
1 answer
39 views

I am following the guide here in the Getting started document to complete the Testing for your feature module, but I keep getting the following exceptions even if my feature struct conforms to the ...
Abdulrahman Abdulkarim's user avatar
0 votes
0 answers
54 views

I’m running into an issue with my Foundry tests and can’t figure out what’s going wrong. When I run on a local Anvil fork, everything passes just fine. But when I switch to a mainnet fork, I keep ...
NOS Magical's user avatar
4 votes
0 answers
70 views

I am working on a project for which I need to run unit test using ceedling framework. I have done the necessary config in the .yml file. During the build stage, one of the macros ...
Yaaro Obba's user avatar
1 vote
1 answer
55 views

Problem: I’m migrating a Vue 2.6 app to the Composition API (via the plugin) and hit two testing issues with vue-test-utils (v1) + Jest: Jest couldn’t mock functions from a plain TS module (not a Vue ...
Makc's user avatar
  • 1,192
1 vote
1 answer
53 views

I have built a Roslyn diagnostic analyzer and code fix provider, both of which are working as expected. However, I am unable to unit test them because I have been unable to figure out how to add the ...
Dominick's user avatar
  • 496

1
2 3 4 5
1716