Category "unit-testing"

Disable Coverage on Untested Files - Jest

When using @vue/cli-plugin-unit-jest, I am receiving coverage reports each time I run my unit tests, regardless of whether I have the --coverage flag in the exe

Is it possible to mock a function imported from a package in golang?

I have the following method to test, which uses a function imported from a package. import x.y.z func abc() { ... v := z.SomeFunc() ... } Is it

How do I write a Rust unit test that ensures that a panic has occurred?

I have a Rust function that panics under some condition and I wish to write a test case to validate whether the function is panicking or not. I couldn't find an

how to set up postgres database with pytest-django?

I would like pytest-django to install a Postgres extension when it creates a test database. I've been mucking with conftest.py to try to get this to work, but

What are assertions in JEST?

It's documentation says that while dealing with async code, expect.assertions(x) should be written. What exactly do assertions refer to? Is it a term of plain J

Spring Boot - Test for controller fails with 404 code

I want to write a test for controller. Here is test snippet: @RunWith(SpringRunner.class) @WebMvcTest(WeatherStationController.class) @ContextConfiguration(cla

React-testing-library: changes due to input

I'm trying to test that a component updates as it should due to changes in an input element. I use the fireEvent.change()-function, and if I then check the valu

Using the testing tools, need to write a function that makes the test cases pass for IndexOf with a string and a character

I have the test cases that my teacher wants us to implement using testing tools available in Visual Studio: str c Result ________________________ null

Getting 'ReferenceError: describe is not defined' error when going to start the application

I'm going to test typescript(inversify) code using jest. Below mentioned the code that use to test a controller method. describe('Test UserController',() =>{

how to view WTForms validation errors?

I am writing some basic tests and have a test failing. def test_new_user_registration(self): self.client.get('/user/register') form = RegistrationForm(

Your project does not reference ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFramework,Version=v4.6.2" in the "TargetFrameworks"

I can't run my unit tests. I have the next error: Your project does not reference ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFrame

How do I obtain 100% coverage when an exception is thrown in a unit test?

In C# you can catch an exception in the default test suite like this: [TestMethod] [ExpectedException(typeof (ArgumentNullException))] public void TestNullComp

React testing library, how to open a Collapse in Ant Design

I want to write a unit test that opens an antd. Collapse <Panel /> But no matter what combination of fireEvent or userEvent mouse actions I try, I cannot

How to do live self monitoring inside the application

We are applying unittests, integration tests and we are practicing test driven and behaviour driven development. We are also monitoring our applications and ser

Is it possible to use Dependency Injection with xUnit?

I have a test class with a constructor that needs an IService. public class ConsumerTests { private readonly IService _service; public ConsumerTests(IS

Why cant unittest.TestCases see my py.test fixtures?

I'm trying to use py.test's fixtures with my unit tests, in conjunction with unittest. I've put several fixtures in a conftest.py file at the top level of the p

Unit testing angular 5 component with @ViewChild

I am using angular 5.2.0. I have a child component import { Component } from '@angular/core'; @Component({ template: `<div><div></div></

Why do ReSharper and the built-in MSTest runner ignore my tests that aren't supposed to be ignored?

I'm running Visual Studio 2013 (with latest updates) with ReSharper 8.1 (latest stable version). I'm trying to run my tests as usual, but they keep acting as if

Why do ReSharper and the built-in MSTest runner ignore my tests that aren't supposed to be ignored?

I'm running Visual Studio 2013 (with latest updates) with ReSharper 8.1 (latest stable version). I'm trying to run my tests as usual, but they keep acting as if

Best way to override FastAPI dependencies for testing with a different dependency for each test

According to FastAPI official documentation the recommended way to override the dependencies for testing is to do it globally before all tests are run: asy