# moisty

> A moist package to test your application using vanilla JS

Latest version **1.0.4** (published 2018-03-10) · ISC license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2018-03-10 |
| First published | 2018-03-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.8 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dkeen0123, jestfer, joshuajfholloway, kotauror, lwkchan, telgi |

## Links

- npm: https://www.npmjs.com/package/moisty
- Repository: https://github.com/lwkchan/moist
- Homepage: https://github.com/lwkchan/moist#readme
- Issues: https://github.com/lwkchan/moist/issues
- npm.io page: https://npm.io/package/moisty

## Recent versions

- 1.0.4 (latest) — 2018-03-10
- 1.0.3 — 2018-03-09
- 1.0.2 — 2018-03-09
- 1.0.1 — 2018-03-09
- 1.0.0 — 2018-03-08
- 0.0.4 — 2018-03-08
- 0.0.3 — 2018-03-08
- 0.0.2 — 2018-03-07
- 0.0.1 — 2018-03-06

## README

An npm package to test your application using pure vanilla JavaScript.

https://www.npmjs.com/package/moisty 

## Example Usage of Basic Matchers

Example model:

```
function Notepad(name) {
  this.content = []
  this.name = name
  this.colors = []
}
```

Example test file:

```
(function notepadIsEmpty() {
  var notepad = new Notepad();
  expect.toBeEmpty(notepad.content);
})();

(function notepadNameIsDefined() {
  var notepad = new Notepad('My notepad');
  expect.toBeTrue(notepad.name != undefined);
})();

(function notepadNameCanBeSet() {
  var notepad = new Notepad('Moisty Notepad');
  expect.toEqual(notepad.name, 'Moisty Notepad');
})();

(function notepadCanIncludeColors() {
  var notepad = new Notepad();
  notepad.colors.push('blue');
  expect.toInclude(notepad.colors, 'blue');
})();
```

## Example Usage of beforeEach and It blocks

```
describe('Notepad', function() {
  var notepad;

  beforeEach(function() {
    // We create a new instance of Notepad before running every it block
    notepad = new Notepad();
  });

  it('----> it is empty*', function() {
    expect.toBeEmpty(notepad.content);
  });

  it('----> it includes Hello Moon', function() {
    notepad.content.push('Hello Moon!');
    expect.toInclude(notepad.content, 'Hello Moon!'); => True
  });

  it('----> it includes Hello Moon', function() {
    notepad.content.push('Hello World');
    expect.toInclude(notepad.content, 'Hello Moon'); => False
  });
});
```

## HTML Runner

![HTML Moist Runner](/public/moisty-screenshot.png?raw=true)

## NOW WITH GIFS!

### When tests fail:

![Not Moist](/public/spongebob-gif.gif)

### When tests pass:

![Moist](/public/moist-gif.gif)

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