Skip to content

AndersDJohnson/mocha-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A mocha UI & reporter to list tests without running.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published