karma-iframes
Advanced tools
Comparing version
@@ -11,2 +11,7 @@ # 1.1 | ||
## 1.1.2 | ||
* Easier debugging of individual suites, even after reload. | ||
* Allow query params after requests to iframe or its script. | ||
# 1.0 | ||
@@ -20,2 +25,2 @@ | ||
* First public release | ||
* First public release |
@@ -12,4 +12,6 @@ let fs = require('fs'); | ||
log.debug(`Processing ${file.path} to be loaded separately into iframe`); | ||
// Add matchable suffix to identify (and for correct mime-typing) | ||
file.path += '.iframe.html'; | ||
// Avoid renaming the file multiple times after a watch-reload | ||
file.path = `${file.contentPath ? file.path : file.originalPath}.iframe.html`; | ||
@@ -16,0 +18,0 @@ let transformedFilePath = file.originalPath.replace(/(\/|\\)/g, '_') + '.js'; |
@@ -73,3 +73,3 @@ let path = require('path'); | ||
let reverseContextFile = files.served.find(function(file) { | ||
let reverseContextFile = files.served.find((file) => { | ||
return (file.originalPath === REVERSE_CONTEXT) || (file.originalPath === (REVERSE_CONTEXT.split(path.sep).join('/'))); | ||
@@ -90,3 +90,3 @@ }); | ||
return function contextRewriteMiddleware(req, res, next) { | ||
if(!isIFrameHtml(req.url)) { | ||
if(!isIFrameHtml(req._parsedUrl.pathname)) { | ||
return next(); | ||
@@ -93,0 +93,0 @@ } |
@@ -18,3 +18,3 @@ let fs = require('fs'); | ||
let file = `${TMP_STATIC_FILES_DIR}/${req.url.substr(STATIC_PREFIX.length)}`; | ||
let file = `${TMP_STATIC_FILES_DIR}/${req._parsedUrl.pathname.substr(STATIC_PREFIX.length)}`; | ||
@@ -21,0 +21,0 @@ log.debug(`Searching for file to ${req.url} in ${file}`); |
{ | ||
"name": "karma-iframes", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Lets you run each test in a separate context, loaded as an iframe.", | ||
@@ -12,3 +12,5 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "karma start --single-run" | ||
"test": "RUN_IN_PARENT=true npm run test-try-twice && RUN_IN_PARENT=false npm run test-try-twice", | ||
"test-try-twice": "npm run test-run || npm run test-run", | ||
"test-run": "karma start --single-run" | ||
}, | ||
@@ -21,3 +23,3 @@ "keywords": [ | ||
"peerDependencies": { | ||
"karma": ">=0.13" | ||
"karma": ">=1.2" | ||
}, | ||
@@ -24,0 +26,0 @@ "author": "Raphael Schweikert <any@sabberworm.com>", |
62399
0.72%550
0.18%