Comparing version 0.1.0 to 0.1.1
@@ -42,3 +42,3 @@ module.exports = function(opts) { | ||
// create a blob for opts.html and set as iframe `src` attribute | ||
var blob = new Blob([opts.html], {type: 'text/html;charset=UTF-8'}) | ||
var blob = new Blob([opts.html], { type: 'text/html;charset=UTF-8' }) | ||
var targetUrl = URL.createObjectURL(blob) | ||
@@ -45,0 +45,0 @@ tempIframe.src = targetUrl |
{ | ||
"name": "iframe", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "higher level api for creating and using iframes in browsers", | ||
@@ -13,3 +13,4 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "~2.3.2" | ||
"tape": "~2.3.2", | ||
"domready": "~0.2.13" | ||
}, | ||
@@ -16,0 +17,0 @@ "testling": { |
11
test.js
var test = require('tape') | ||
var domready = require('domready') | ||
var iframe = require('./') | ||
test('it adds an iframe to the document by default', function(t) { | ||
t.equal(document.querySelectorAll('iframe').length, 0, 'no frames') | ||
var frame = iframe({ body: 'hello world' }) | ||
t.equal(document.querySelectorAll('iframe').length, 1, 'one frame') | ||
t.end() | ||
domready(function () { | ||
t.equal(document.querySelectorAll('iframe').length, 0, 'no frames') | ||
var frame = iframe({ body: 'hello world' }) | ||
t.equal(document.querySelectorAll('iframe').length, 1, 'one frame') | ||
t.end() | ||
}) | ||
}) |
5631
59
2