All Questions
Tagged with testing unit-testing
6,647
questions
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"
[...
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 "./...
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("...
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
...
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 ...
-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 ...
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 ...
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, ...
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 ...
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 ...
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, ...
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 ...
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);
...
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.
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-...