fdim / jasmine-unit-test-generator Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
fakeElementRef = jasmine.createSpyObj<ElementRef<HTMLElement>>('ElementRef<HTMLElement>', []);
Code above fails at runtime, as jasmine requires at least one method. In this case it might be better to fallback to
fakeElementRef = { } as ElementRef<HTMLElement>;
since it is a common use case, it should be supported by default
Generated code should have a subject for router events (if used) and params/paramMap/queryParams/queryParamMap
EDIT: handler should also provide RouterTestingModule to component, to handle a case when routerLink is used in template
I was testing out this library(thanks for your hard work by the way), and I believe I ran across a small bug. I ran the generate script on a component that uses ActivatedRoute.
constructor(private route: ActivatedRoute, private messageService: MessageService) { }
this.route.params.pipe(take(1)).subscribe((params) => {// do stuff})
The tooling generated the following code, which fails to compile due to a typing error:
fakeRoute = jasmine.createSpyObj<ActivatedRoute>('ActivatedRoute', ['']);
I believe it should be:
fakeRoute = jasmine.createSpyObj<ActivatedRoute>('ActivatedRoute', []);
I believe this happens whenever you inject a service but don't call any methods on that service.
getting this error
fakeRouter = jasmine.createSpyObj<Router>("Router", []);
fakeAuthenticationService = jasmine.createSpyObj<AuthenticationService>("AuthenticationService", []);
error log
Chrome Headless 107.0.5304.107 (Windows 10) AppComponent should create FAILED
Failed: createSpyObj requires a non-empty array or object of method names to create spies for
at failCallback (node_modules/zone.js/dist/zone-testing.js:1369:46)
at apply (node_modules/zone.js/dist/zone-testing.js:1427:25)
start using waitForAsync instead async in component test
Hey Domas,
This project is quite interesting. How hard is it to make it work flawlessly?
I mean, the project currently creates a great boilerplate but the ultimate goal could be to create all positive and negative tests.
I'd like to understand what are the pitfalls you have already seen :)
When this decorator is used, values should be provided this way in the component test
TBD
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.