A testbed is a platform for experimentation of large development projects. Testbeds allow for rigorous, transparent, and replicable testing of new technologies or code in an isolated environment.
Questions tagged [testbed]
157 questions
4
votes
1 answer
Angular2 testing with TestBed getting Zone undefined Error
I've been working off the Angular tutorial https://angular.io/docs/ts/latest/guide/testing.html to build my first unit tests. I am able to get everything to work until I get to the TestBed example. When I add TestBed into the mix I get 'Uncaught…

Tye2545
- 191
- 2
- 8
4
votes
2 answers
Testbed stub for Google App Engine 'search'
I am trying to test Google App Engine's new full text search functionality in Python with the development appserver.
Is there a stub for the search that allows one to test it with the testbed local unit testing?
The following is example code that…

Brian M. Hunt
- 81,008
- 74
- 230
- 343
3
votes
1 answer
Regular Expressions Testbed
I am currently attempting to implement a regular expression engine. (Yes, for fun. Go fig.)
I am working from this site for general algorithmic approach: http://swtch.com/~rsc/regexp/regexp1.html
My question for you all is: do you know of a…

ibiwan
- 88
- 5
3
votes
1 answer
Angular9 debugElement.classes['my-class'] now returns undefined
I'm updating a repo that used to use Angular 8.
In a test, using TestBed, I'm checking if a class exists using:
fixture.debugElement.classes['my-class'].toBe(false)
After updating to Angular 9, this test no longer works, as the expression no longer…

Timotei Manolache
- 305
- 4
- 14
3
votes
1 answer
NullInjectorError: No provider for MatDialogRef! Angular Test
I'm new to angular and jhipster, I've edited the login component and I've added the formbuilder and MatDialogRef and update the Unit test:
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from…

Zakaria CHOUKCHOU BRAHAM
- 31
- 1
- 4
3
votes
1 answer
Angular:Why NO_ERRORS_SCHEMA does not work for attribute?
I'm writing my first Angular tests and having a problem here. I'm testing a component, which has a custom attribute in it
...
Official documentation says
The NO_ERRORS_SCHEMA tells the Angular…

Majesty
- 2,097
- 5
- 24
- 55
3
votes
1 answer
Testbed: Error: Can't resolve all parameters for PriDateInput: (?)
I'm trying to create a Angular Component using the TestBed but I'm getting the following error:
Error: Can't resolve all parameters for PriDateInput: (?).
error properties: Object({ ngSyntaxError: true })
The component PriDateInput has a…

Ricardo Rocha
- 14,612
- 20
- 74
- 130
3
votes
3 answers
Angular TestBed: Can't bind to 'ngModel' since it isn't a known property of 'ng-select'
I'm trying to use TestBed from to test a Angular component that has a ng-select in its HTML.
I've first got the error saying that Can't bind to 'items' since it isn't a known property of 'ng-select'. so I've imported NgSelectModule and added it to…

Timotei Manolache
- 305
- 4
- 14
3
votes
2 answers
Angular 4 ngModel not updated after input change in tests
I have a simple application that have 1 input:
@Component({ selector: 'mycomponent', styles: [
], template: `
Name:

jpereira
- 251
- 2
- 11
3
votes
2 answers
Ionic 2: Error testing with Karma/Jasmine/TestBed
I'm new with Ionic2 and I was following this tutorial and a simple test like
describe('Dummy test', () => {
it('should do nothing', () => {
expect(true).toBeTruthy();
expect(1 + 1).toBe(2);
});
});
works fine, but for some reason I…

João Paulo Ribeiro
- 31
- 3
3
votes
1 answer
TestBed: Component doesn't compile when imported through a module
I am currently trying to write a set of unit test for a component that uses another component tag within its html.

Iltharion
- 165
- 2
- 12
3
votes
2 answers
Data generation for QA tests
This question is kind of general and not very specific.
We have a java project that uses Oracle database. We are currently using SoapUI tool for the QA tests. Each test needs some data to exist on the database before it is run. Our current way of…

Michael
- 22,196
- 33
- 132
- 187
2
votes
2 answers
Google App Engine os.environ changes require module reload
I was trying to change the os.environ dict to simulate a logged in user on Google App Engine, as documented at https://stackoverflow.com/a/6230083/1241454.
from google.appengine.api import users
import webapp2
import os
class…

Andrew F
- 595
- 1
- 3
- 16
2
votes
0 answers
Either my Jest plugin works or my npm run test in Angular 14 project
I'm in an Angular Jest configuration paradoxon please help me.
I am using Jest (Orta) plugin in VSCode for my Angular 14 project,
but I need to make sure that my test are working fine from the command line as well.
If I fix one, the other is unable…

Bazidoa
- 44
- 5
2
votes
1 answer
How to test components with ngx-translate's TranslatePipe? TypeError: Cannot read properties of undefined (reading 'subscribe')
I have a component which itself does not inject the TranslationService into the constructor. But I use the translate pipe in the html files. The test always fails with this error:
TypeError: Cannot read properties of undefined (reading…

Apollo
- 1,296
- 2
- 11
- 24