Move public APIs into their own folder
And start writing actual tests for them
This commit is contained in:
parent
724361af6a
commit
960812308c
9 changed files with 192 additions and 6 deletions
29
api/tests/test-limiter.js
Normal file
29
api/tests/test-limiter.js
Normal 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")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue