0

Is there a way to debug a single test in angular? For example: I created a simple service called test-service. A Simple test-service.spec.ts file created automatically with a test inside. I can call ng test an everything works fine. But how can i set a breakpoint inside that spec.ts file? I try to do it with Protractor, but if run the test I get this error:

E/launcher - Error: Error: Cannot find module...

Im using intellij as ide.

1 Answer 1

1

I think Protractor is for end to end tests.

To debug a single test, change it to fit or if you want to run the suite change describe to fdescribe.

You can do console debugging by using console.log and seeing the terminal. If an instance of a browser opens when you do ng test, then if you put debugger; in an it test it should get tripped (open the developer tools quickly). If you are running headless (no browser opens), you can modify your karma.conf.js to open a browser for tests.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.