<commit_before>---
template: default.ejs
theme: dark
title: Unexpected
repository: https://github.com/unexpectedjs/unexpected
---

# Welcome to Unexpected

# The extensible BDD assertion toolkit

```js
const library = {
  name: 'un3xp3c73d',
  created: 2013,
  site: 'https://unexpected.js.org'
};

expect(library, 'to satisfy', {
  name: 'Unexpected',
  created: 2013
});
```

```output
expected { name: 'un3xp3c73d', created: 2013, site: 'https://unexpected.js.org' }
to satisfy { name: 'Unexpected', created: 2013 }

{
  name: 'un3xp3c73d', // should equal 'Unexpected'
                      //
                      // -un3xp3c73d
                      // +Unexpected
  created: 2013,
  site: 'https://unexpected.js.org'
}
```

## Badges

[![NPM version](https://badge.fury.io/js/unexpected.svg)](https://www.npmjs.com/package/unexpected)
[![Build Status](https://api.travis-ci.org/unexpectedjs/unexpected.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected)
[![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected/badge.svg)](https://coveralls.io/github/unexpectedjs/unexpected)
[![Dependency Status](https://david-dm.org/unexpectedjs/unexpected.svg)](https://david-dm.org/unexpectedjs/unexpected)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/unexpectedjs/unexpected?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Github](https://img.shields.io/github/stars/unexpectedjs/unexpected.svg?label=Star&maxAge=2592000&style=flat)](https://github.com/unexpectedjs/unexpected)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=<KEY>--692805fea09bec4c4ea7c898fa9208a0fa61283e)](https://www.browserstack.com/automate/public-build/cjVWSDFIaERKWVdxc2s5bStaY08vMUFwbW1NbTdzZHJmVXBCUjBlemo3Yz0tLU5iL3I0L3Z4elVhZjBTbWtvbmpHRnc9PQ==--692805fea09bec4c4ea7c898fa9208a0fa61283e)

## Features

- Extensible
- Fast
- Provides really nice error messages
- Helps if you misspell assertions
- Compatible with all test frameworks
- Node.JS ready (`require('unexpected')`)
- Supports [asynchronous assertions using promises](./api/addAssertion/#asynchronous-assertions)
- Single global with no prototype extensions or shims
- Cross-browser: works on Chrome, Firefox, Safari, Opera, IE11, Edge

### Node

Install it with NPM or add it to your `package.json`:

```<commit_msg>docs: use correct writing form for Node.js<commit_after>---
template: default.ejs
theme: dark
title: Unexpected
repository: https://github.com/unexpectedjs/unexpected
---

# Welcome to Unexpected

# The extensible BDD assertion toolkit

```js
const library = {
  name: 'un3xp3c73d',
  created: 2013,
  site: 'https://unexpected.js.org'
};

expect(library, 'to satisfy', {
  name: 'Unexpected',
  created: 2013
});
```

```output
expected { name: 'un3xp3c73d', created: 2013, site: 'https://unexpected.js.org' }
to satisfy { name: 'Unexpected', created: 2013 }

{
  name: 'un3xp3c73d', // should equal 'Unexpected'
                      //
                      // -un3xp3c73d
                      // +Unexpected
  created: 2013,
  site: 'https://unexpected.js.org'
}
```

## Badges

[![NPM version](https://badge.fury.io/js/unexpected.svg)](https://www.npmjs.com/package/unexpected)
[![Build Status](https://api.travis-ci.org/unexpectedjs/unexpected.svg?branch=master)](https://travis-ci.org/unexpectedjs/unexpected)
[![Coverage Status](https://coveralls.io/repos/unexpectedjs/unexpected/badge.svg)](https://coveralls.io/github/unexpectedjs/unexpected)
[![Dependency Status](https://david-dm.org/unexpectedjs/unexpected.svg)](https://david-dm.org/unexpectedjs/unexpected)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/unexpectedjs/unexpected?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Github](https://img.shields.io/github/stars/unexpectedjs/unexpected.svg?label=Star&maxAge=2592000&style=flat)](https://github.com/unexpectedjs/unexpected)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=<KEY>)](https://www.browserstack.com/automate/public-build/cjVWSDFIaERKWVdxc2s5bStaY08vMUFwbW1NbTdzZHJmVXBCUjBlemo3Yz0tLU5iL3I0L3Z4elVhZjBTbWtvbmpHRnc9PQ==--692805fea09bec4c4ea7c898fa9208a0fa61283e)

## Features

- Extensible
- Fast
- Provides really nice error messages
- Helps if you misspell assertions
- Compatible with all test frameworks
- Node.js ready (`require('unexpected')`)
- Supports [asynchronous assertions using promises](./api/addAssertion/#asynchronous-assertions)
- Single global with no prototype extensions or shims
- Cross-browser: works on Chrome, Firefox, Safari, Opera, IE11, Edge

### Node

Install it with NPM or add it to your `package.json`:

```
{'fraction_non_alphanumeric': 0.1546325878594249, 'fraction_numerical': 0.04089456869009585, 'mean_word_length': 4.811881188118812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 36, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5249093', 'n_tokens_mistral': 1835, 'n_tokens_neox': 1659, 'n_words': 256}