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

chai-v8-optimisation

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-v8-optimisation

A V8 optimisation assertion plugin for chai.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Gratipay donate button

A V8 optimisation assertion plugin for chai.

Install

NPM

  • Use: require('chai-v8-optimisation')
  • Install: npm install --save chai-v8-optimisation

Usage

Using with chaijs

var chai = require("chai"),
    v8opt = require("chai-v8-optimisation");
    
chai.use(v8opt);

Running your tests: (In order to analyse optimisation the --allow-natives-syntax flag needs to be passed to node or iojs)

node --allow-natives-syntax ./node_modules/mocha/bin/_mocha test/your-tests.js

Testing your functions:

    function fn() {}
    expect(fn).optimisation("yes");
    expect(fn).to.be.optimised;
    function fn() {
      try{}catch(e){}
    }
    expect(fn).optimisation("no");
    expect(fn).not.to.be.optimised;

Other usages for the optimisation method

expect(fn).optimisation("always");  // always-optimized
expect(fn).optimisation("never");   // never-optimized
expect(fn).optimisation("maybe");   // maybe-deoptimized

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button

Contributors

No contributors yet! Will you be the first? Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

  • The #{type} License

Keywords

FAQs

Package last updated on 27 Feb 2015

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