1

I want to invoke jasmine tests from within an Angular controller.

I want to kick off the jasmine tests from within my angular application.

Are there examples of running jasmine tests and loading the jasmine environment outside of Node and Karma Test Runner.

Thanks

2 Answers 2

1

There is a boot.js file that automatically loads the spec test files and executes them.

To override them we did our own custom boot file.

http://jasmine.github.io/2.0/boot.html

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

Comments

0

Unless you're writing an app whose sole purpose is to be a test runner that runs Jasmine unit tests, you shouldn't be using production code to run your tests. You should be looking for alternative test runners to node and karma. You may have luck finding a solution that integrates with your IDE, like ReSharper or IntelliJ IDEA, but that depends on what IDE you are using to develop.

2 Comments

Agreed. Our goal is to allow a debug tab to be deployed to development to only test Rest API's. We also want to be able to run these tests using Karma on the dev machine and build machine.
@user2215624 calling tests from your app in a specific environment isn't really a common practice, but of course your use case may call for it. If you're using an IDE that can integrate with Grunt or Gulp, like Visual Studio, you may be better off creating tasks that run the tests that you can trigger in your IDE. Of course, running tasks does require Node to be installed on your development boxes, but that may not be a problem, because you're only using Node to run the grunt/gulp command, not making Node part of your build/deployment process.

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.