Is there a way to run headless jasmine JavaScript tests from IntelliJ? I've seen the jstestdriver plugin and that works for in browser testing, but I couldn't find a way to run headless jasmine tests inside the IDE.
I ended up writing a class to parse the js test driver config and generate a spec for the jasmine file. Then I used gradle's envjs plugin run the spec file.
Related
I have a bunch of QUnit tests. I am testing my code against html templates. For these tests I am using HTML template importing feature.
I have the following on the top of the JavaScript test file.
///<template path="mytemplate.html" mode="script" id="mytemplate" type="text/ng-template" />
If I run the tests using the VS 2015 Chutzpah plugin, the tests run fine but they fail if I use ReShaper(ReShaper ultimate 10.2). ReShaper won't recognize the template reference.
Has anyone tried to get ReShaper to run QUnit tests by using templates ? If this is not possible on ReShaper, has anyone tried to access html files during there QUnit tests which will work with ReShaper ?
After looking at ReSharper documentation looks like Reshaper doesn't really support Chutzpah. ReSharper will run Jasmine and QUnit.
ReShaper will however work with a custom html harness which could be generated by chutzpah.
This is something that unfortunately doesn't work for me because the html templates could change during development.
Maybe QUnit has a way to inject html templates in QUnit fixture.
On the Protractor site (http://www.protractortest.org/#/infrastructure), it says Protractor uses Selenium for browser automation. Then on the Grunt site (http://gruntjs.com/) it says Grunt is also for automation. If they are both for automation, I'm not sure what are the differences between the two and how they fit together. In some ways, my question is this: Why would I need Grunt if I'm using Protractor?
"Automation" itself is quite a broad term.
These are completely different tools:
protractor is a wrapper around WebDriverJS and used for end-to-end testing
grunt is a javascript task runner
You can actually run protractor tests via grunt.
Using testacular is it possible to run Jasmine and Mocha through tests at the same time using the same configuration file 'testacular.conf.js and running it in intellij?
OR can you only use one at a time? So only Jasmine OR Mocha?
No worries. So far I found out it is impossible but that is ok. I am using chai to replace jasmine. However, now i have problems with angular-mocks.js being understood. New problem woo
how do you integrate Jasmine's test runner with Visual Studio and your custom build process ? I've read an article at codebetter that shows how to achieve this task using FubuMVC and a few other components but I was wondering if you can recommend any alternatives ?
So how do you do that at your workplace ?
Many thanks,
Tomek
Take a look at Chutzpah (http://chutzpah.codeplex.com/). It has integrated test runners and command line options for running Jasmine or QUnit tests. Behind the scenes it uses PhantomJS, a headless browser, to load up tests and run them.
I know this is a year old, but FYI, I noticed that a new AngularJS SPA Template project (ASP.NET) in Visual Studio 2013 includes Jasmine (SpecRunner.cshtml). The AngularJS SPA Template is an extension to VS2013 (and can be installed on VS2012 and VS2010).
So it is there now, go to extensions and updates in VS to find it!
I've been writing JavaScript unit tests using Jasmine. However, those tests run inside a browser, not as part of MSTest.
I want my TFS Continuous Integration builds to break when a JavaScript unit test fails. I know there is a solution for this in Visual Studio 2012, but I'm on 2010 (and will be for a long time in the future probably).
Is there an easy way to integrate Jasmine based JavaScript unit tests with TFS Build?
The Chutzpah test runner enables you to run your QUnit and Jasmine JavaScript unit tests from the command line or Visual Studio.
Therefore you should be able to integrate it into your TFS build via the InvokeProcess activity.
I'd use nodejs + jasmine-node, but you can also look at http://phantomjs.org/ with a junit reporter. Jasmine-node provides a junit reporter with the --junitreport output. You might also look at the TFS Build Extensions (http://visualstudiogallery.msdn.microsoft.com/2d7c8577-54b8-47ce-82a5-8649f579dcb6/view/Discussions/) and the activities in there. It includes a xml transform for JUnit to TRX (test results xml) which can be pushed into TFS.