-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.js
More file actions
49 lines (37 loc) · 1.28 KB
/
test.js
File metadata and controls
49 lines (37 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
describe('prefixes', function () {
'use strict';
var assume = require('assume')
, prefixes = require('./');
/* istanbul ignore next */
global.webkitRequestAnimationFrame = function raf() {};
/* istanbul ignore next */
global.mozWebSocket = function ws() {};
/* istanbul ignore next */
global.oSetTimeout = function ws() {};
it('is exported as function', function () {
assume(prefixes).is.a('function');
});
it('exposes the .vendor array list', function () {
assume(prefixes.vendor).is.a('array');
});
it('can find a mozWebSocket', function () {
var found = prefixes('WebSocket', global);
assume(found).is.a('function');
assume(found).equals(global.mozWebSocket);
});
it('defaults to global', function () {
var found = prefixes('WebSocket');
assume(found).is.a('function');
assume(found).equals(global.mozWebSocket);
});
it('automatically UpperCases the first char', function () {
var found = prefixes('requestAnimationFrame', global);
assume(found).is.a('function');
assume(found).equals(global.webkitRequestAnimationFrame);
});
it('finds unprefixed first', function () {
var found = prefixes('setTimeout', global);
assume(found).is.a('function');
assume(found).equals(global.setTimeout);
});
});