Skip to content

Commit cc84a4a

Browse files
author
Jeff Escalante
committed
implement basic test suite
- 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
1 parent 3bf1f1f commit cc84a4a

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
*.lock
44
*.DS_Store
55
node_modules
6+
test/bundle.js

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Contributing
2+
------------
3+
4+
### Running the Tests
5+
6+
1. Make sure [nodejs](http://nodejs.org) is installed
7+
2. Run `npm install -g browserify testling; npm i` from your command line
8+
3. Run `npm test` from your command line and check the console

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "scrollReveal.js",
3-
"version": "0.0.0",
3+
"version": "0.0.4",
44
"description": "Declarative on-scroll reveal animations",
55
"main": "scrollReveal.js",
66
"directories": {
77
"test": "test"
88
},
99
"scripts": {
10-
"test": "browserify test/test.js > test/bundle.js; open test/test.html"
10+
"test": "browserify test/test.js > test/bundle.js; testling",
11+
"browser": "browserify test/test.js > test/bundle.js; open test/test.html"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -19,11 +20,15 @@
1920
"url": "https://github.com/julianlloyd/scrollReveal.js/issues"
2021
},
2122
"testling": {
22-
"files": "test/*.js",
23+
"html": "test/test.html",
2324
"browsers": [
2425
"ie/8..latest",
2526
"chrome/latest",
26-
"firefox/latest"
27+
"firefox/latest",
28+
"safari/latest",
29+
"iphone/6",
30+
"ipad/6",
31+
"android-browser/latest"
2732
]
2833
},
2934
"homepage": "https://github.com/julianlloyd/scrollReveal.js",

test/test.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class='t1' data-scroll-reveal='enter left and move 50px over 1.33s'>test 1</div>
2+
3+
<script src='dist/scrollReveal.js'></script>
4+
<script>new scrollReveal</script>
5+
<script src="test/bundle.js"></script>

test/test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var test = require('tape');
2+
3+
test('basic', function(t){
4+
var test_styles = document.querySelector('div').style;
5+
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; ');
6+
t.end();
7+
});

0 commit comments

Comments
 (0)