Skip to content

Commit

Permalink
Added Pointer Tests & Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
roryhardy committed Feb 11, 2018
1 parent 369bcfc commit a73578a
Show file tree
Hide file tree
Showing 11 changed files with 2,670 additions and 364 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"env": {
"testing": {
"presets": [
"es2015"
]
"presets": ["es2015"]
}
},
"presets": [
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Navigate through the slides by swiping up, down, left, or right. See the [config

Swiping upwards with two hands will toggle the overview mode. A second swipe will exit the overview.

## Misc
## Callouts

reveal-leap-js includes [LeapJS][4], developed by [Leap Motion][1] for your
convenience. LeapJS is licensed under the Apache 2.0 license which can be
Expand Down
29 changes: 29 additions & 0 deletions mocha_setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Setup for Mocha testing.
* This file defines globals, DOM, etc which need to be instantiated prior
* to any tests being run.
*/

// eslint-disable-next-line import/no-extraneous-dependencies
const { JSDOM } = require('jsdom');

const jsdom = new JSDOM('<!doctype html><html><body></body></html>');
const { window } = jsdom;

global.window = window;
global.document = window.document;

// Mock the global Reveal object
global.Reveal = {
getConfig: () => ({
'reveal-leap-motion': {
gestureDelay: -15, // Remove delays to simplify tests
pointerColor: '#55cc00',
},
}),
down: () => {},
left: () => {},
right: () => {},
toggleOverview: () => {},
up: () => {},
};
Loading

0 comments on commit a73578a

Please sign in to comment.