# cf-test-focus

> Cloudflare Focus Test Util

Latest version **2.2.5** (published 2018-03-28) · BSD-3-Clause license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cf-test-focus
pnpm add cf-test-focus
yarn add cf-test-focus
bun add cf-test-focus
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.2.5 |
| Published | 2018-03-28 |
| First published | 2016-05-16 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Kyle |
| Maintainers | adamschwartz, cf-ci, cf-ci-write, ereeves, hamidagh, handrews, hturan, inikulin, jculvey, johndotawesome, jparyani-cloudflare, manatarms, marksteyn, miksu, mpint, nkcmr, rreverser, ryan0x44, sejoker, teffenellis, terinjokes, toekneestuck, vasturiano |

## Links

- npm: https://www.npmjs.com/package/cf-test-focus
- npm.io page: https://npm.io/package/cf-test-focus

## Dependencies (1)

- [cf-test-stub](https://npm.io/package/cf-test-stub.md) ^2.2.5

## Recent versions

- 2.2.5 (latest) — 2018-03-28
- 2.2.4 — 2018-03-27
- 2.2.3 — 2017-10-23
- 2.2.2 — 2017-10-20
- 2.2.1 — 2017-09-22
- 2.2.0 — 2017-03-20
- 2.0.1 — 2017-02-27
- 2.0.0 — 2016-12-01
- 1.0.1 — 2016-06-14
- 1.0.0 — 2016-05-16

## README

# cf-test-focus

> Cloudflare Focus Test Util

## Installation

```sh
$ npm install cf-test-focus
```

## Usage

```js
import assert from 'assert';
import {trackFocus, getCurrentFocus} from 'cf-test-focus';

describe('exampleModule', () => {
  it('should do something with focus', () => {
    const stub = trackFocus();
    exampleModule.doSomething();
    assert.ok(stub.called);
    assert.equal(getCurrentFocus(), document.getElementById('#expected-focused-element'));
    // This will happen automatically in between tests.
    stub.restore();
  });
});
```

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