From 1e620cfe1ba778dc20c5ff0b292aef1c7833e902 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Fri, 28 Feb 2014 19:08:33 -0500 Subject: [PATCH] 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 - https://github.com/substack/testling/issues/68 --- .gitignore | 1 + CONTRIBUTING.md | 8 ++++++++ README.md | 1 + package.json | 13 +++++++++---- test/test.html | 5 +++++ test/test.js | 7 +++++++ 6 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 test/test.html create mode 100644 test/test.js diff --git a/.gitignore b/.gitignore index 5ab90ec5..934c601a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.lock *.DS_Store node_modules +test/bundle.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..3e2e8ff3 --- /dev/null +++ b/CONTRIBUTING.md @@ -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 diff --git a/README.md b/README.md index d6e43a6c..28d03cd6 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ A simple way to create and maintain how elements fade in, triggered when they en [![scrollReveal version](https://badge.fury.io/gh/julianlloyd%2FscrollReveal.js.png)](http://badge.fury.io/gh/julianlloyd%2FscrollReveal.js) *** + ####**[→ View Demo ←](http://julianlloyd.me/scrollreveal)** *** Installation diff --git a/package.json b/package.json index 61f65849..5815f80c 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/test/test.html b/test/test.html new file mode 100644 index 00000000..eb2e4779 --- /dev/null +++ b/test/test.html @@ -0,0 +1,5 @@ +
test 1
+ + + + diff --git a/test/test.js b/test/test.js new file mode 100644 index 00000000..4317ec3b --- /dev/null +++ b/test/test.js @@ -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(); +});