Socket
Socket
Sign inDemoInstall

mocha-list

Package Overview
Dependencies
10
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mocha-list

A mocha UI & reporter to list tests without running.


Version published
Weekly downloads
2K
decreased by-9.3%
Maintainers
1
Install size
123 kB
Created
Weekly downloads
 

Readme

Source

mocha-list

A mocha UI & reporter to list tests without running.

Useful if you want to provide a report of test cases covered.

Use

yarn add --dev mocha-list (copy) npm install --save-dev mocha-list (copy)

CLI

To run, e.g., on tests in tests/runs:

mocha --ui mocha-list --reporter mocha-list tests/runs

API

You may need custom code to mock certain globals from your tests. You can do so by creating a script to run your tests programmatically.

We expose a mocha-list/run file to make this easy.

import run from 'mocha-list/run'
import stubObjProxy from 'stub-obj-proxy'
import { join } from 'path'

const testDir = join(__dirname, 'runs')

const mochaOpts = {}

// You can mock whatever you need to here.
global.window = stubObjProxy()

run(testDir, mochaOpts)

For more examples, see:

Development

We have to link mocha-list to itself since third party reporters read from node_modules:

yarn link-self

FAQs

Last updated on 15 Mar 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc