# turndown-attendant

> Test runner for HTML to Markdown conversions with Turndown

Latest version **0.0.3** (published 2020-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install turndown-attendant
pnpm add turndown-attendant
yarn add turndown-attendant
bun add turndown-attendant
```

## 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.3 |
| Published | 2020-03-05 |
| First published | 2017-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dom Christie |
| Maintainers | domchristie |

## Links

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

## Dependencies (2)

- [tape](https://npm.io/package/tape.md) ^4.8.0
- [jsdom](https://npm.io/package/jsdom.md) ^16.2.0

## Recent versions

- 0.0.3 (latest) — 2020-03-05
- 0.0.2 — 2017-11-09
- 0.0.1 — 2017-11-01

## README

# turndown-attendant

Test runner for HTML to Markdown conversions with Turndown

## Usage

Specify you input HTML and your expected output in an HTML file:

```html
<!-- test.html -->
<div class="case", data-name="headings">
  <div class="input">
    <h1>Hello world</h1>
  </div>
  <pre class="expected"># Hello world</pre>
</div>
```

Create a new attendant with the `TurndownService` class, the HTML file, and optionally a `beforeEach` function which gets called with the new `TurndownService` instance. (This is useful for applying plugins.) Then call `run` to run the test cases.

```js
var TurndownService = require('turndown')
var Attendant = require('turndown-attendant')

var attendant = new Attendant({
  Turndown: TurndownService,
  file: '/path/to/test.html',
  beforeEach: function (turndownService) {
    turndownService.use(…)
  }
})

attendant.run()
```

To run tests that do not require HTML or a DOM, access `test` on the `attendant` instance:

```js
attendant.test('test something else', function (t) { … })
```

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