🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

karma-iframes

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-iframes - npm Package Compare versions

Comparing version

to
1.1.2

7

CHANGELOG.md

@@ -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

4

lib/preprocessor.js

@@ -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>",