I'm just in the middle of implementing some Jasmine tests for jQuery mobile that I'm working on, I encountered an error that I was able to track before adding the jQuery mobile library, the error is the following:
Jasmine.js:1769 TypeError: Cannot read property 'abort' of undefined.
As soon as I remove the jQM dependency, the error will disappear.
This is my code:
<!DOCTYPE html> <html> <head> <title>HTML5/Common/Tests</title> <link type="text/css" rel="stylesheet" href="libs/jasmine.css" media="screen"> <link type="text/css" rel="stylesheet" href="../../Common/libs/jquery.mobile-1.0.1.css" /> <script type="text/javascript" src="libs/jasmine.js"></script> <script type="text/javascript" src="libs/jasmine-html.js"></script> <script type="text/javascript" src="../../Common/libs/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="../../Common/libs/jquery.mobile-1.0.1.min.js"></script> <script type="text/javascript" src="../../Common/libs/myLib.js"></script> <script type="text/javascript"> describe("Suite 1", function() { it("Should be that 1 equals 0", function() { expect(0).toEqual(1); }); }); </script> </head> <body> <script type="text/javascript"> jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); jasmine.getEnv().execute(); </script> </body> </html>
I would prefer to use Jasmine for this application instead of qUnit , as I find it more flexible and easier to implement in CI and explain to BA and PM's .. however, after messing with this problem for several hours and some useless google searches , I still could not solve it, so I'm starting to consider the transition.
Before I do this, did anyone experience the same problem and find a solution for it?
Thanks and respect.
UPDATE March 20:
Ticket in github Jasmine project:
https://github.com/pivotal/jasmine/issues/204
source share