Skip to content

Commit

Permalink
implement basic test suite
Browse files Browse the repository at this point in the history
- based on tape and testling
- does not currently work on testling-ci
- this is probably testling-ci's fault
- does work quite nicely locally
- tape-testing/testling#68
  • Loading branch information
Jeff Escalante committed Mar 3, 2014
1 parent 3bf1f1f commit cc84a4a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.lock
*.DS_Store
node_modules
test/bundle.js
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Contributing
------------

### Running the Tests

1. Make sure [nodejs](http://nodejs.org) is installed
2. Run `npm install -g browserify testling; npm i` from your command line
3. Run `npm test` from your command line and check the console
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "scrollReveal.js",
"version": "0.0.0",
"version": "0.0.4",
"description": "Declarative on-scroll reveal animations",
"main": "scrollReveal.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "browserify test/test.js > test/bundle.js; open test/test.html"
"test": "browserify test/test.js > test/bundle.js; testling",
"browser": "browserify test/test.js > test/bundle.js; open test/test.html"
},
"repository": {
"type": "git",
Expand All @@ -19,11 +20,15 @@
"url": "https://github.com/julianlloyd/scrollReveal.js/issues"
},
"testling": {
"files": "test/*.js",
"html": "test/test.html",
"browsers": [
"ie/8..latest",
"chrome/latest",
"firefox/latest"
"firefox/latest",
"safari/latest",
"iphone/6",
"ipad/6",
"android-browser/latest"
]
},
"homepage": "https://github.com/julianlloyd/scrollReveal.js",
Expand Down
5 changes: 5 additions & 0 deletions test/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class='t1' data-scroll-reveal='enter left and move 50px over 1.33s'>test 1</div>

<script src='dist/scrollReveal.js'></script>
<script>new scrollReveal</script>
<script src="test/bundle.js"></script>
7 changes: 7 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var test = require('tape');

test('basic', function(t){
var test_styles = document.querySelector('div').style;
t.equal(test_styles.cssText, '-webkit-transform: translateX(0px); opacity: 1; -webkit-transition-property: all; -webkit-transition-duration: 1.33s; -webkit-transition-timing-function: ease-in-out; -webkit-transition-delay: 0s; -webkit-perspective: 1000; -webkit-backface-visibility: hidden; ');
t.end();
});

0 comments on commit cc84a4a

Please sign in to comment.