1 | [![Get it on NPM](https://img.shields.io/npm/v/@testdeck/mocha.svg)](https://www.npmjs.com/package/@testdeck/mocha)
|
2 | [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
|
3 | [![Build Status](https://github.com/testdeck/testdeck/actions/workflows/ci.yml/badge.svg)](https://github.com/testdeck/testdeck/actions/workflows/ci.yml)
|
4 | [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=testdeck_mocha&metric=coverage)](https://sonarcloud.io/summary/new_code?id=testdeck_mocha)
|
5 | [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=testdeck_mocha&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=testdeck_mocha)
|
6 | [![Issues](https://img.shields.io/github/issues/testdeck/testdeck/@testdeck/mocha)](https://github.com/testdeck/testdeck/issues)
|
7 | [![Pull Requests](https://img.shields.io/github/issues-pr/testdeck/testdeck/@testdeck/mocha)](https://github.com/testdeck/testdeck/pulls)
|
8 |
|
9 | ## @testdeck/mocha
|
10 |
|
11 | Mocha tests in OOP style!
|
12 |
|
13 | ```TypeScript
|
14 | import { suite, test } from "@testdeck/mocha";
|
15 | import { expect } from 'chai';
|
16 |
|
17 | @suite
|
18 | class Hello {
|
19 |
|
20 | @test
|
21 | world() {
|
22 | expect(false).to.be.true;
|
23 | }
|
24 | }
|
25 | ```
|
26 |
|
27 | With support for
|
28 |
|
29 | - test suite inheritance by either extension or mixins
|
30 | - individual naming of both suites and tests
|
31 | - parameterised tests
|
32 |
|
33 | and more...
|
34 |
|
35 | If you are looking for other test framework support, please see the following packages
|
36 |
|
37 | - [@testdeck/jasmine](https://npmjs.com/package/@testdeck/jasmine)
|
38 | - [@testdeck/mocha](https://npmjs.com/package/@testdeck/mocha)
|
39 | - [@testdeck/vitest](https://npmjs.com/package/@testdeck/vitest)
|
40 |
|
41 | ## Installation
|
42 |
|
43 | ```shell
|
44 | npm install --save-dev @types/mocha mocha @testdeck/mocha
|
45 | ```
|
46 |
|
47 | Additional dependencies need to be installed, unless you use the seed below or follow the instructions in the setup
|
48 | guide for which a link has been provided below.
|
49 |
|
50 | ## Getting Started
|
51 |
|
52 | To get you started, a [seed has been provided](https://github.com/testdeck/testdeck-mocha-seed) that can help you with
|
53 | setting up your project.
|
54 |
|
55 | ```shell
|
56 | git clone https://github.com/testdeck/testdeck-mocha-seed.git
|
57 | ```
|
58 |
|
59 | ## Additional Information
|
60 |
|
61 | You can find a lot more information in the [official documentation](https://testdeck.org/), especially in the
|
62 | [setup guide](https://testdeck.org/pages/guide/setup).
|