2.2.5 • Published 7 years ago

cf-test-focus v2.2.5

Weekly downloads
73
License
BSD-3-Clause
Repository
-
Last release
7 years ago

cf-test-focus

Cloudflare Focus Test Util

Installation

$ npm install cf-test-focus

Usage

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();
  });
});
2.2.5

7 years ago

2.2.4

7 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago