Jayr Motta
Jayr Motta

Reputation: 718

How do I run a single Testacular Unit Test?

This post asks how to run a single E2E test but with no accepted answer. There the author mention that he is able to run a single Unit Test by keeping the cursor on top of the test he wants to run, but it doesn't work for me and it doesn't make too much sense since the detection is made when there are changes on the file (the detection uses modified date not content).

I've a lot of tests to a single class and running all of them is extremely hard to figure out some bugs. There are other better alternatives to Testacular that enables interactive debugging and running tests in a manual manner?

Upvotes: 2

Views: 543

Answers (2)

Andy Armstrong
Andy Armstrong

Reputation: 688

I've written up my approach on this related question:

https://stackoverflow.com/a/33302720/501870

The short answer is that I use Karma with this plugin which lets you run individual Jasmine tests directly from the browser:

https://www.npmjs.com/package/karma-jasmine-html-reporter

You can then use your browser's developer tools to set breakpoints, evaluate expressions etc.

Upvotes: 0

Jayr Motta
Jayr Motta

Reputation: 718

I've discovered that by adding an "i" before the test worked as I wanted, but the debugging problem continued. In this question answered by Joseph Eames a lot of questions on this are answered and I'm going to check the tips on debugging and other test runner.

Upvotes: 1

Related Questions