# @types/nodeunit

> TypeScript definitions for nodeunit

Latest version **0.0.36** (published 2024-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/nodeunit
pnpm add @types/nodeunit
yarn add @types/nodeunit
bun add @types/nodeunit
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.36 |
| Published | 2024-07-29 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51419 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/nodeunit
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodeunit
- npm.io page: https://npm.io/package/@types/nodeunit

## Recent versions

- 0.0.36 (latest) — 2024-07-29
- 0.0.35 (ts4.5) — 2023-11-07
- 0.0.32 (ts4.2) — 2021-07-08
- 0.0.31 (ts3.1) — 2020-05-15
- 0.0.30 (ts2.0) — 2016-10-11
- 0.0.34 — 2023-10-18
- 0.0.33 — 2023-09-23
- 0.0.29 — 2016-09-19
- 0.0.28 — 2016-07-14
- 0.0.27-alpha — 2016-07-08
- 0.0.26-alpha — 2016-07-04
- 0.0.25-alpha — 2016-07-02
- 0.0.24-alpha — 2016-07-01
- 0.0.23-alpha — 2016-07-01
- 0.0.22-alpha — 2016-05-25
- … 3 more at https://npm.io/package/@types/nodeunit/versions

## README

# Installation
> `npm install --save @types/nodeunit`

# Summary
This package contains type definitions for nodeunit (https://github.com/caolan/nodeunit).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodeunit.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodeunit/index.d.ts)
````ts
// Imported from: https://github.com/soywiz/typescript-node-definitions/nodeunit.d.ts

export interface ITestCase {
    (testCase: { [property: string]: ITestBody | ITestGroup | void }): void;
}
export declare var testCase: ITestCase;

export interface Test {
    done: ICallbackFunction;
    expect(num: number): void;

    // assersions from node assert module
    fail(actual: any, expected: any, message: string, operator: string): void;
    assert(value: any, message: string): void;
    ok(value: any, message?: string): void;
    equal(actual: any, expected: any, message?: string): void;
    notEqual(actual: any, expected: any, message?: string): void;
    deepEqual(actual: any, expected: any, message?: string): void;
    notDeepEqual(actual: any, expected: any, message?: string): void;
    strictEqual(actual: any, expected: any, message?: string): void;
    notStrictEqual(actual: any, expected: any, message?: string): void;
    throws(block: any, error?: any, message?: string): void;
    doesNotThrow(block: any, error?: any, message?: string): void;
    ifError(value: any): void;

    // assertion wrappers
    equals(actual: any, expected: any, message?: string): void;
    same(actual: any, expected: any, message?: string): void;
}

// Test Group Usage:
//  var testGroup: nodeunit.ITestGroup = {
//      setUp: (callback) => {
//           callback();
//      },
//      tearDown: (callback) => {
//            callback();
//      },
//      test1: (test: nodeunit.Test) => {
//          test.done();
//      }
//    }
//    exports.testgroup = testGroup;

export interface ITestBody {
    (callback: Test): void;
}

export interface ITestGroup {
    /** The setUp function is run before each test */
    setUp?: ((callback: ICallbackFunction) => void) | undefined;
    /** The tearDown function is run after each test calls test.done() */
    tearDown?: ((callback: ICallbackFunction) => void) | undefined;
    [property: string]: ITestGroup | ITestBody | ((callback: ICallbackFunction) => void) | undefined;
}

export interface ICallbackFunction {
    (err?: any): void;
}

````

### Additional Details
 * Last updated: Mon, 29 Jul 2024 19:36:25 GMT
 * Dependencies: none

# Credits
These definitions were written by .

---
_Source: https://npm.io/package/@types/nodeunit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
