Online Angular unit test generator. Star Issue Discuss

For those who are are not a fan of test-driven development, generate unit tests for Angular classes after coding is done.

1. Select one of Angular class type on the left.
2. Modify the default typescript with your own.
3. Click 'Generate' button to see the result

Then, you will see auto-generated Angular unit test here.
Loading...

How does it work?

1. Parse a Typescript file and find the following.

2. Compile Typescript to Javascript, then parse the Javascript, and get the following.

3. build ejs data from #1 and #2, and generate test code.

Have you ever coded an Angular unit tests from the scratch, and struggling to handle errors with missing mocks and mocks? How did you like it? I assume your answer to this is "not so much". Because writing a successful Angular unit test is mostly copy, paste, and modification. The most important thing is it's not a pleasant task.

Copy, paste, and mofification. and again copy, paste, and modificaton. This can be automated, right? So, this is the result.

You can generate an Angular unit test with a command!!