Permalink
Browse files

Node support: wire up Jasmine on Node too.

Re-uses the existing Jasmine spec; it's just modified to require() Mailcheck.
  • Loading branch information...
aseemk committed Jul 26, 2013
1 parent 0255d5b commit 93a21c1ad953dd232182c9a0a1da2f98dc1a2a2f
Showing with 17 additions and 3 deletions.
  1. +4 −1 .gitignore
  2. +4 −1 package.json
  3. +9 −1 spec/mailcheckSpec.js
View
@@ -1 +1,4 @@
.DS_Store
.DS_Store
node_modules
npm-debug.log
View
@@ -31,12 +31,15 @@
"docs": "https://github.com/Kicksend/mailcheck/blob/master/README.md",
"dependencies": {
},
"devDependencies": {
"jasmine-node": "1.x"
},
"main": "src/mailcheck.js",
"repository": {
"type": "git",
"url": "git://github.com/aseemk/mailcheck.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "jasmine-node spec/"
}
}
View
@@ -6,7 +6,9 @@ describe("mailcheck", function() {
var mailcheck;
beforeEach(function(){
mailcheck = Kicksend.mailcheck;
// We may be running in a CommonJS environment.
// If so, mailcheck won't be in a global Kicksend object.
mailcheck = typeof Kicksend !== 'undefined' ? Kicksend.mailcheck : require('../');
});
describe("run", function () {
@@ -216,6 +218,12 @@ describe("mailcheck", function() {
});
});
// Browser-only code below:
if (typeof window === 'undefined') {
return;
}
describe("jquery.mailcheck", function () {
var suggestedSpy, emptySpy;

0 comments on commit 93a21c1

Please sign in to comment.