Move public APIs into their own folder

And start writing actual tests for them
This commit is contained in:
Pat Cavit 2016-05-18 17:18:52 -07:00
parent 724361af6a
commit 960812308c
9 changed files with 192 additions and 6 deletions

29
api/tests/test-limiter.js Normal file
View file

@ -0,0 +1,29 @@
"use strict"
var o = require("../../ospec/ospec")
var domMock = require("../../test-utils/domMock")
var async = require("./async")
var limiter = require("../limiter")
o.spec("fps limiter", function() {
var $window, root
[ "setTimeout", "requestAnimationFrame" ].forEach(function(type) {
o.spec(type, function() {
o.beforeEach(function() {
$window = domMock()
async[type]($window)
})
o("is a function", function() {
o(typeof limiter).equals("function")
})
o("it returns a function", function() {
o(typeof limiter(false)).equals("function")
})
})
})
})