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

@error-paparazzi/jest

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@error-paparazzi/jest - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/index.d.ts

10

lib/index.js

@@ -10,6 +10,4 @@ "use strict";

const puppeteer_1 = __importDefault(require("puppeteer"));
const screenshot = async () => {
const browser = await puppeteer_1.default.launch({
defaultViewport: { width: 375, height: 812 }
});
const screenshot = async ({ launchOptions } = { launchOptions: {} }) => {
const browser = await puppeteer_1.default.launch(launchOptions);
const page = await browser.newPage();

@@ -21,3 +19,3 @@ await page.setContent(document.documentElement.outerHTML);

};
exports.takeScreenshotOnError = () => {
exports.takeScreenshotOnError = (params) => {
const makeScreenshotOnFail = (fn) => async () => {

@@ -29,3 +27,3 @@ try {

if (!is_ci_1.default)
await screenshot();
await screenshot(...params);
throw e;

@@ -32,0 +30,0 @@ }

3

package.json
{
"name": "@error-paparazzi/jest",
"version": "0.0.1",
"private": false,
"version": "0.0.2",
"description": "Make screenshot of JSDOM when your jest test failed",

@@ -6,0 +5,0 @@ "main": "lib/index.js",

import isCi from "is-ci";
import open from "open";
import tmp from "tmp";
import pupetter from "puppeteer";
import pupetter, { LaunchOptions } from "puppeteer";
const screenshot = async () => {
const browser = await pupetter.launch({
defaultViewport: { width: 375, height: 812 }
});
const screenshot = async (
{ launchOptions }: { launchOptions?: LaunchOptions } = { launchOptions: {} }
) => {
const browser = await pupetter.launch(launchOptions);
const page = await browser.newPage();

@@ -17,3 +17,5 @@ await page.setContent(document.documentElement.outerHTML);

export const takeScreenshotOnError = () => {
export const takeScreenshotOnError = (
params: Parameters<typeof screenshot>
) => {
const makeScreenshotOnFail = (fn: any) => async () => {

@@ -23,3 +25,3 @@ try {

} catch (e) {
if (!isCi) await screenshot();
if (!isCi) await screenshot(...params);
throw e;

@@ -26,0 +28,0 @@ }

@@ -11,4 +11,4 @@ {

// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
// "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
"declaration": true /* Generates corresponding '.d.ts' file. */,
"declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,
"sourceMap": true /* Generates corresponding '.map' file. */,

@@ -15,0 +15,0 @@ // "outFile": "./", /* Concatenate and emit output to single file. */

Sorry, the diff of this file is not supported yet

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