4.0.1 • Published 2 months ago

auto-globals v4.0.1

Weekly downloads
67
License
MIT
Repository
github
Last release
2 months ago

auto globals NPM version Build Status Coverage Status

Add browser globals on every test, and remove when it is done.

Install

npm i auto-globals

Example

const autoGlobals = require('auto-globals');
const tape = autoGlobals(require('supertape'));

const fn = () => {
    document.body.addEventListener('click', console.log);
};

test('lib: arguments', (t, {document}) => {
    fn();
    
    t.ok(document.body.calledWith('click', console.log), 'should call addEventListener');
    t.end();
});

Related

  • try-catch - functional try-catch wrapper.
  • try-to-catch - functional try-catch wrapper for promises.
  • try-to-tape - wrap tape async functions and show error on reject.

License

MIT

4.0.1

2 months ago

4.0.0

2 months ago

3.1.0

5 months ago

3.0.0

1 year ago

2.0.0

3 years ago

1.9.2

5 years ago

1.9.1

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago