# litetest

> [![npm version](https://badge.fury.io/js/litetest.svg)](https://badge.fury.io/js/litetest)

Latest version **1.0.7** (published 2023-03-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install litetest
pnpm add litetest
yarn add litetest
bun add litetest
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-03-15 |
| First published | 2023-03-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | 0xinuarashi |

## Links

- npm: https://www.npmjs.com/package/litetest
- npm.io page: https://npm.io/package/litetest

## Recent versions

- 1.0.7 (latest) — 2023-03-15
- 1.0.6 — 2023-03-13
- 1.0.5 — 2023-03-13
- 1.0.4 — 2023-03-13
- 1.0.3 — 2023-03-13
- 1.0.2 — 2023-03-13
- 1.0.1 — 2023-03-09
- 1.0.0 — 2023-03-09

## README

# LiteTest

[![npm version](https://badge.fury.io/js/litetest.svg)](https://badge.fury.io/js/litetest)

LiteTest is a lightweight testing library for JavaScript. With LiteTest, you can write tests for your JavaScript code and ensure that it works as expected.

## Installation

To use LiteTest in your project, you'll need to install it using npm. You can do this by running the following command:

```npm install litetest```

## Usage

LiteTest provides two methods for making assertions in your tests: `assert` and `assertn`.

### `assert(value_, assert_, errMsg_)`

The `assert` method is used to test whether a value is equal to an expected value. It takes three parameters:

- `value_` - the actual value to test
- `assert_` - the expected value
- `errMsg_` - an error message to display if the assertion fails

Here's an example of how to use `assert`:

```js
const litetest = require('litetest');

litetest.assert(value_, 4, 'value_ should equal 4');
```

### assertn(value_, assertn_, errMsg_)

The assertn method is used to test whether a value is not equal to an expected value. It takes three parameters:

- `value_` - the actual value to test
- `assertn_` - the expected value
- `errMsg_` - an error message to display if the assertion fails

Here's an example of how to use `assertn`:

```js
const litetest = require('litetest');

litetest.assertn(value_, 5, 'value_ should not equal 5');
```

### `agree(value_, assert_)`

The `agree` function is used to test whether a value is equal to an expected value. It takes two parameters:

- `value_` - the actual value to test
- `assert_` - the expected value

The function returns a boolean value indicating whether the test passed or failed.

Here's an example of how to use `agree`:

```js
const litetest = require('litetest');

// Test if 2 + 2 equals 4
litetest.agree(2 + 2, 4); // Returns true

// Test if a variable is equal to a string
const myString = 'hello';
litetest.agree(myString, 'hello'); // Returns true
```

## Contributing

We welcome contributions from the community! If you find a bug or have a suggestion for how to improve LiteTest, please open an issue or submit a pull request on GitHub.

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