# chai-leaflet

> Chai assertions to use with Leaflet map apps

Latest version **0.0.13** (published 2017-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install chai-leaflet
pnpm add chai-leaflet
yarn add chai-leaflet
bun add chai-leaflet
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2017-07-26 |
| First published | 2013-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Jan Pieter Waagmeester |
| Maintainers | jieter |
| Keywords | chai, testing, assertions, leaflet, map, gis |

## Links

- npm: https://www.npmjs.com/package/chai-leaflet
- Repository: https://github.com/jieter/chai-leaflet
- Homepage: https://github.com/jieter/chai-leaflet#readme
- Issues: https://github.com/jieter/chai-leaflet/issues
- npm.io page: https://npm.io/package/chai-leaflet

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.0.13 (latest) — 2017-07-26
- 0.0.12 — 2016-04-18
- 0.0.11 — 2016-02-11
- 0.0.10 — 2015-03-16
- 0.0.9 — 2015-03-16
- 0.0.8 — 2013-11-28
- 0.0.7 — 2013-11-18
- 0.0.6 — 2013-11-12
- 0.0.5 — 2013-11-12
- 0.0.3 — 2013-11-09
- 0.0.2 — 2013-11-09

## README

# chai-leaflet

Chai assertions to test Leaflet apps.

## Usage
In the browser, just add `<script src="chai-leaflet.js"></script>` after including chai. Now you can write tests like this:

```JavaScript
chai.should();

it('example', function () {
	latlng.should.be.near([51, 4]);

	map.should.have.view([33, 2], 4);

	map.should.have.zoom(18);
});
```

Because chai-leaflet depends on a global `L` it does not work out of the box on node.js. You may use [leaflet-headless](https://github.com/jieter/leaflet-headless) to work around that.

```JavaScript

var L = require('leaflet-headless');
var chai = require('chai');
chai.use(require('chai-leaflet'));

chai = chai.should();

// your tests here
```

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