Does Protractor come with Jasmine 2.x yet? - javascript

I was reviewing Protractor website and saw this paragraph mention that Protractor development is in the process of upgrading to Jasmien 2.0.
Currently, Jasmine Versions 1.3 and 2.0 are supported. Jasmine 1.3 is the default test framework and is available for use when you install Protractor. However, we're in the process of upgrading to Jasmine 2.0, and will deprecate support for 1.3 in the future.
After digging further into GitHub documentation, it looks like Jasmine 2.0 is already supported. Does their website need to be revised?

This documentation page can probably be improved to avoid confusion. Most importantly, it points out that nowadays (since protractor 1.6.0), both jasmine 1.x and jasmine 2.x are supported and you can choose which one to use.
There is a specific setting that controls the behavior:
framework: "jasmine" // or "jasmine2" for jasmine 2.x

Related

JavaScript test runner that supports native modules

Is there a JavaScript test runner that supports native modules?
UPDATE for 2022: Jest now supports native modules experimentally. Complete information on configuring it, and information about current issues, can be found in the Jest docs.
Facebook's Jest supports native modules fairly painlessly through the use of the babel-jest plugin.
I'm not aware of any runners that don't require transpilation. Would love to know about them if they exist.
There is another answer here that discusses using Node's experimental module support to test with Jasmine, but I'm not sure this is better: https://stackoverflow.com/a/47835049/3084820
You can try Karma,
Jest or Jasmine.
Onestly, I prefer Karma or Jest

Running Jasmine tests from Node against code that uses RequireJS

Is it possible to run Jasmine from Node to test code that uses RequireJS?
I am using the Jasmine NPM. I can run some tests from Node but can't work out how to test my code that uses RequireJS.
V2 of jasmine-node (that supports Jasmine 2.x) has had RequireJS support removed.
Is there an incompatibility with the require keyword because this is used by Node and RequireJS? Perhaps I am misunderstanding something fundamental?
If I have to use a task runner I would favour
If anyone has any experience or thoughts to share, that would be greatly appreciated!
I am using:
Node 0.10.24
RequireJS 2.1.22
Jasmine 2.3.4

How to use Protractor with Angular 2?

I use Protractor with Angular 1.x. I would like to migrate to Angular 2.0 step by step but I don't see Protractor in the docs.
Has protractor been dropped since Angular 2? Should I write my tests without using Protractor, using Jasmine instead (or others)?
You can test Angular 2 applications with Protractor (starting from Protractor 2.5.0).
For Protractor 5.0.0+, you don't have to do anything specific, Protractor will auto-detect the Angular version used in the application under test.
For Protractor >= 2.5.0 and <= 4.0.14, you would only need to add useAllAngular2AppRoots: true to your config. Here is a sample.
Note that several built-in Protractor matchers would not yet work with Angular2, see:
Protractor Angular 2 Failed: unknown error: angular is not defined
There is also that Protractor+Angular2 problem in Firefox (still unresolved), see:
Can't run Selenium via Protractor on Firefox after update to Angular 2

Jasmine test runner integration with visual studio and a build process

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!

JSpec vs Jasmine vs QUnit for javascript and jQuery testing in Rails

I am looking for a unit testing framework to use with javascript that integrates well with Rails 3.0
Anyone with experience with above frameworks can share their experience?
** UPDATE: JSpec is now discontinued as per their Github repository: http://github.com/visionmedia/jspec so this leaves Jasmine and QUnit
Jasmine works just fine with Rails 3, check out for how to integrate it: http://pivotallabs.com/users/dwfrank/blog/articles/1427-jasmine-in-rails-3
Check out the qunit for rails plugin if you use Qunit.
I've used QUnit on projects written in .NET and Java. In both worlds, we had to homebrew the integration. I don't expect Rails integration to be any more forthcoming.

Categories

Resources