forked from exupero/saveSvgAsPng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
27 lines (23 loc) · 742 Bytes
/
test.js
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
var test = require('tape');
test('Is loadable using requirejs', function (assert) {
var requirejs = require('requirejs');
requirejs(['./saveSvgAsPng'], function(saveSvgAsPng) {
assert.ok(saveSvgAsPng, 'Loads saveSvgAsPng module.');
var contract = {
'svgAsDataUri': 'function',
'svgAsPngUri': 'function',
'saveSvgAsPng': 'function',
'download': 'function',
'prepareSvg': 'function',
'saveSvg': 'function',
};
for (var property in saveSvgAsPng) {
if (saveSvgAsPng.hasOwnProperty(property)) {
var expectedType = contract[property];
var message = 'Has ' + property + ' of type ' + expectedType;
assert.equals(typeof saveSvgAsPng[property], expectedType, message);
}
}
assert.end();
});
});