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

cypress-smart-logs

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-smart-logs

Cypress plugin to enhance work with logs.

  • 0.0.7
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

cypress-smart-logs

Cypress plugin allowing to add additional information to logs and configure the output.

Setup plugin

Change your cypress/plugins/index.ts

/// <reference types="cypress" />

import smartLogs = require("cypress-smart-logs/plugin");

module.exports = (on: Cypress.PluginEvents, config: Cypress.ConfigOptions) => {
  smartLogs.install(on, config);
};

Register commands

Change your cypress/support/index.ts

/// <reference types="." />

import "cypress-smart-logs/commands";

// use this construct to add new warning type
Cypress.SmartLogs.setLogType("WARNING", {
  format: "*",
  target: { openMode: ["file", "window"], runMode: ["file"] },
  pairedCommands: ["custom"],
});

// this custom commands is bound to WARNING log type
Cypress.Commands.add("custom", () => {
  Cypress.log({});
});

and add type defs to cypress/support/index.d.ts

/// <reference types="cypress-smart-logs" />

declare namespace Cypress {
  interface ILogTypes {
    WARNING: ILogTypeConfig;
  }

  interface Chainable<Subject> {
    custom(): Cypress.Chainable<void>;
  }
}

Additional settings

Logs are by default saved only for failed cases. In run mode are window logs disabled.

Additional configuration can be defined in Cypress.SmartLogs.Config object.

FAQs

Package last updated on 21 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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