Trevor Lalish-Menagh
unread,Nov 16, 2010, 11:05:12 AM11/16/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Jasmine
Hello all,
I am integrating Jasmine into my maven build process and have run into
a puzzling problem.
I am testing a library that sets cookies and local storage. To verify
that my library works, I check document.cookie to see if the cookie
was set.
Since cookies don't exist locally, I can only get the tests to pass if
I put my Jasmine HTML file on a web server (I use Sinatra).
But, it seems that when I run the tests in my maven build process,
they run as if locally, thus they break.
Barring spinning up a web server to run the tests in my build process,
does anyone know how to mock document?
I tried adding:
beforeEach(function () {
document = {"cookie": ""};
});
but it seems I am not allowed to override document. Any ideas?
Yours,
Trevor