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

@microsoft/extra-shot-mocha

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/extra-shot-mocha

This package is an extension of [Mocha](https://mochajs.org/).

  • 0.0.2-alpha.a32ea10b4.0
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-3.45%
Maintainers
4
Weekly downloads
 
Created
Source

Extra Shot Mocha

This package is an extension of Mocha.

Install

npm install --save-dev @microsoft/extra-shot-mocha

Features

  • support for custom data to "it"

it

Sometimes, we're gonna add extra data to our test cases and show it in the report. You can use this "it" to replace mocha.it.

(Currently, this depends on Mochawesome as reporter. We'll develop a new reporter later.)

import it from "@microsoft/extra-shot-mocha";
import { describe } from "mocha";
import { expect } from "chai";

describe("extra shot mocha it tests", async () => {
  it("should run as normal mocha.it with sync arrow function", () => {
    expect(1).equals(1);
  });

  it("should run as normal mocha.it with async arrow function", async () => {
    expect(1).equals(1);
  });

  it("should inject ctx with async function", { a: 1 }, async function () {
    expect(1).equals(1);
  });

  it("should inject ctx with async arrow function", { a: 1 }, async () => {
    expect(1).equals(1);
  });

  it("should inject ctx with sync function", { a: 1 }, function () {
    expect(1).equals(1);
  });

  it("should inject ctx with sync arrow function", { a: 1 }, () => {
    expect(1).equals(1);
  });
});

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

FAQs

Package last updated on 13 Jun 2023

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