Add npm and minified builds

This commit is contained in:
Niklas von Hertzen
2017-12-03 17:07:10 +08:00
parent 9445b0b598
commit 7e0b2b5201
6 changed files with 80 additions and 66 deletions

View File

@ -1,24 +1,15 @@
var assert = require('assert');
var path = require('path');
var html2canvas = require('../../');
const assert = require('assert');
const html2canvas = require('../../');
describe('Package', function() {
it('should have html2canvas defined', function() {
describe('Package', () => {
it('should have html2canvas defined', () => {
assert.equal(typeof html2canvas, 'function');
});
});
describe.only('requirejs', function() {
var requirejs = require('requirejs');
requirejs.config({
baseUrl: path.resolve(__dirname, '../../dist')
});
it('should have html2canvas defined', function(done) {
requirejs(['html2canvas'], function(h2c) {
assert.equal(typeof h2c, 'function');
it('should have html2canvas defined', done => {
html2canvas('').catch((err) => {
assert.equal(err, 'Provided element is not within a Document');
done();
});
})
});
});