Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expressen/tallahassee

Package Overview
Dependencies
Maintainers
4
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expressen/tallahassee - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/getHeaders.js

7

lib/Document.js
"use strict";
const cheerio = require("cheerio");
const getHeaders = require("./getHeaders");
const getLocation = require("./getLocation");

@@ -12,9 +13,5 @@ const Url = require("url");

function Document(resp) {
const {request} = resp;
const {header} = request || {};
const {cookie, Cookie} = header || {};
const location = getLocation(resp.request);
let cookieHeader = getHeaders(resp).cookie || "";
let cookieHeader = cookie || Cookie || "";
const $ = cheerio.load(resp.text, {decodeEntities: false});

@@ -21,0 +18,0 @@ const loaded = [];

"use strict";
const getHeaders = require("./getHeaders");
const supertest = require("supertest");

@@ -8,4 +9,5 @@ const NodeFetch = require("node-fetch");

const stack = [];
const {cookie, Cookie} = resp.request.header || {};
const {cookie} = getHeaders(resp);
fetching._pendingRequests = stack;

@@ -33,13 +35,15 @@ return fetching;

function getRelative(uri) {
return supertest(app)
.get(uri)
.set("cookie", cookie || Cookie)
.then((res) => {
return {
status: res.statusCode,
json: () => res.body,
text: () => res.text
};
});
const req = supertest(app).get(uri);
if (cookie) {
req.set("cookie", cookie);
}
return req.then((res) => {
return {
status: res.statusCode,
json: () => res.body,
text: () => res.text
};
});
}
};
{
"name": "@expressen/tallahassee",
"version": "0.1.0",
"version": "0.1.1",
"description": "Expressen client testing framework",

@@ -34,3 +34,4 @@ "main": "index.js",

"express": "^4.16.2",
"mocha": "^4.0.1"
"mocha": "^4.0.1",
"nock": "^9.1.4"
},

@@ -37,0 +38,0 @@ "files": [

@@ -8,3 +8,3 @@ Tallahassee

Test your client scripts in a headless browser
Test your client scripts in a headless browser.

@@ -14,5 +14,5 @@ Example:

```javascript
"use strict";
"use strict";
const app = require("../express-js-app");
const app = require("../app/express-js-app");
const Browser = require("@expressen/tallahassee");

@@ -64,2 +64,2 @@ const {Compiler} = require("@expressen/tallahassee/lib/Compiler");

});
``
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc