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

@dollarshaveclub/e2e

Package Overview
Dependencies
Maintainers
29
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dollarshaveclub/e2e - npm Package Compare versions

Comparing version 4.0.0-rc.0 to 4.1.0-rc.0

15

lib/run-test.js

@@ -210,5 +210,12 @@ const debug = require('debug')('dsc-e2e:lib:run-test')

const page = await browser.newPage()
page.on('request', req => {
console.log('REQUEST URL', req.url)
})
// Each page should block non-essential assets/scripts from loading
const isRequestToHost = (request) => request.url().includes(process.env.FACE_E2E_HOSTNAME)
const isVisualAssetRequest = request => ['stylesheet', 'image', 'font'].includes(request.resourceType())
await page.setRequestInterception(true)
page.on('request', request =>
(!isRequestToHost(request) || isVisualAssetRequest(request))
? request.abort()
: request.continue()
)
await page.setViewport({

@@ -412,3 +419,3 @@ width: client.width,

// Metrics Events
parseErrorEmitEvent(result.error, this.context, this.eventsEmitter)
parseErrorEmitEvent(result, this.context, this.eventsEmitter)

@@ -415,0 +422,0 @@ return false // SKIP

@@ -50,3 +50,6 @@

const parseErrorEmitEvent = (err, ctx, emitter) => {
const parseErrorEmitEvent = (result, ctx, emitter) => {
const err = result.error
const stepName = result.name
if (!ctx || !emitter) return

@@ -56,5 +59,5 @@ const testId = ctx.test.id

if (err.code === 'ERR_ASSERTION') {
emitter.emit('run-step.assertion-failure', { testId })
emitter.emit('run-step.assertion-failure', { testId, stepName })
} else if (err.code === 'ETIMEDOUT') {
emitter.emit('run-step.timeout', { testId })
emitter.emit('run-step.timeout', { testId, stepName })
} else if (!err.code) {

@@ -64,8 +67,8 @@ const errString = err.toString().toLowerCase()

if (errString.includes('timeout') || errString.includes('timed out')) {
emitter.emit('run-step.timeout', { testId })
emitter.emit('run-step.timeout', { testId, stepName })
} else {
emitter.emit('run-step.unspecified-failure', { testId })
emitter.emit('run-step.unspecified-failure', { testId, stepName })
}
}
emitter.emit('run-step.failure', { testId })
emitter.emit('run-step.failure', { testId, stepName })
}

@@ -72,0 +75,0 @@

{
"name": "@dollarshaveclub/e2e",
"version": "4.0.0-rc.0",
"version": "4.1.0-rc.0",
"description": "Make End-to-End Testing Great for Once",

@@ -5,0 +5,0 @@ "main": "lib",

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