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

chai-baseline

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-baseline

File-based baseline testing for chai

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by1250%
Maintainers
1
Weekly downloads
 
Created
Source

File-based baseline testing for chai.

chai-baseline adds simplified file-based baseline testing for chai. With it you can compare data to a reference file on disk, storing a local file in the process. This allows for the use of large-scale diff tools to do additional comparisons outside of the tests themselves.

Installation

npm install chai-baseline

Usage

chai-baseline can only be used in NodeJS where it has access to the file system.

Usage with expect

// ES6 syntax (TypeScript, Babel)
import { use, expect } from "chai";
import chaiBaseline from "chai-baseline";
use(chaiBaseline);

// pre-ES6 syntax
var chai = require("chai"), expect = chai.expect;
var chaiBaseline = require("chai-baseline").default;
chai.use(chaiBaseline);

// usage
it("baseline", () => {
    const text = "...output text...";
    return expect(text).to.have.baseline("transpilerOutput.txt", { base: "./baselines" }); // returns Promise
});

Usage with assert

// ES6 syntax (TypeScript, Babel)
import { use, assert } from "chai";
import chaiBaseline from "chai-baseline";
use(chaiBaseline);

// pre-ES6 syntax
var chai = require("chai"), assert = chai.assert;
var chaiBaseline = require("chai-baseline").default;
chai.use(chaiBaseline);

// usage
it("baseline", () => {
    const text = "...output text...";
    return assert.baseline(text, "transpilerOutput.txt", { base: "./baselines" }); // returns Promise
});

FAQs

Package last updated on 12 Jul 2016

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