cypress-intercept-formdata
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -17,3 +17,5 @@ 'use strict'; | ||
} else { | ||
const fieldName = p.match(/; name="([\w-]+)"/)?.[1]; | ||
const fieldMatch = p.match(/; name="([\w-]+)"/); | ||
const fieldName = fieldMatch && fieldMatch[1]; | ||
if (fieldName) { | ||
@@ -31,3 +33,4 @@ res[fieldName] = p.split(`\r\n`)[3]; | ||
const contentType = headers["content-type"]; | ||
const boundary = contentType.match(/boundary=([\w-]+)/)?.[1]; | ||
const boundaryMatch = contentType.match(/boundary=([\w-]+)/); | ||
const boundary = boundaryMatch && boundaryMatch[1]; | ||
@@ -34,0 +37,0 @@ return getFormDataFromRequest(body, boundary); |
{ | ||
"name": "cypress-intercept-formdata", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "cypress command to work with intreception's multipart/form-data requests", | ||
@@ -17,3 +17,3 @@ "main": "lib/index.js", | ||
"cy:run": "wait-on http://localhost:9991 -d 1000 && cypress run", | ||
"e2e": "concurrently --success last --kill-others \"yarn serve\" \"yarn cy:run\"", | ||
"e2e": "yarn build; concurrently --success last --kill-others \"yarn serve\" \"yarn cy:run\"", | ||
"test": "yarn lint && yarn types && yarn e2e" | ||
@@ -20,0 +20,0 @@ }, |
# cypress-intercept-formdata | ||
<p align="center"> | ||
<a href="LICENSE.md"> | ||
<img src="https://img.shields.io/github/license/yoavniran/cypress-intercept-formdata?color=blue&style=plastic" alt="MIT License"/> | ||
</a> | ||
<a href="https://badge.fury.io/js/cypress-intercept-formdata"> | ||
<img src="https://badge.fury.io/js/cypress-intercept-formdata.svg" alt="npm version" height="20"> | ||
</a> | ||
</p> | ||
This package is intended to be used with Cypress.io intercept command. | ||
@@ -4,0 +13,0 @@ |
6166
81
5
42