forked from dropzone/dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
107 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- 0.10 | ||
- 0.8 | ||
- 0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ | |
"email": "[email protected]", | ||
"web": "http://www.matiasmeno.com" | ||
}], | ||
"scripts": { | ||
"test": "node_modules/mocha-phantomjs/bin/mocha-phantomjs test/test.html" | ||
}, | ||
"bugs": { | ||
"mail": "[email protected]" | ||
}, | ||
|
@@ -36,7 +39,10 @@ | |
"grunt-contrib-uglify": "*", | ||
"grunt-component-build": "*", | ||
"grunt-contrib-copy": "*", | ||
"grunt-contrib-watch": "*" | ||
"grunt-contrib-watch": "*", | ||
"mocha-phantomjs": "*", | ||
"mocha": "*", | ||
"chai": "*" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
chai.should() | ||
|
||
describe "Dropzone", -> | ||
describe "constructor()", -> | ||
|
||
it "should throw an exception if the element is invalid", -> | ||
expect(-> new Dropzone "#invalid-element").to.throw "Invalid dropzone element." | ||
|
||
it "should throw an exception if assigned twice to the same element", -> | ||
element = document.createElement "div" | ||
new Dropzone element, url: "url" | ||
expect(-> new Dropzone element, url: "url").to.throw "Dropzone already attached." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" /> | ||
|
||
<div id="mocha"></div> | ||
<script src="../node_modules/mocha/mocha.js"></script> | ||
<script src="../node_modules/chai/chai.js"></script> | ||
<script src="../downloads/dropzone.js"></script> | ||
|
||
<script> | ||
mocha.ui('bdd'); | ||
mocha.reporter('html'); | ||
expect = chai.expect; | ||
chai.should(); | ||
</script> | ||
<script src="test.js"></script> | ||
|
||
<script> | ||
if (window.mochaPhantomJS) { mochaPhantomJS.run(); } | ||
else { mocha.run(); } | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function() { | ||
chai.should(); | ||
|
||
describe("Dropzone", function() { | ||
return describe("constructor()", function() { | ||
it("should throw an exception if the element is invalid", function() { | ||
return expect(function() { | ||
return new Dropzone("#invalid-element"); | ||
}).to["throw"]("Invalid dropzone element."); | ||
}); | ||
return it("should throw an exception if assigned twice to the same element", function() { | ||
var element; | ||
|
||
element = document.createElement("div"); | ||
new Dropzone(element, { | ||
url: "url" | ||
}); | ||
return expect(function() { | ||
return new Dropzone(element, { | ||
url: "url" | ||
}); | ||
}).to["throw"]("Dropzone already attached."); | ||
}); | ||
}); | ||
}); | ||
|
||
}).call(this); |