Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/team-igniter-from-houston-inc/async-fn

Additional methods for different mocking libraries to introduce "late resolve" of promises returned by the mock functions. This allows tests that read chronologically, like a story.
https://github.com/team-igniter-from-houston-inc/async-fn

async async-await bdd javascript jest sinon tdd unit-testing

Last synced: about 2 months ago
JSON representation

Additional methods for different mocking libraries to introduce "late resolve" of promises returned by the mock functions. This allows tests that read chronologically, like a story.

Awesome Lists containing this project

README

        

# asyncFn

![Build and test](https://github.com/team-igniter-from-houston-inc/async-fn/workflows/Build%20and%20test/badge.svg) [![Gitter](https://badges.gitter.im/async-fn/community.svg)](https://gitter.im/async-fn/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

![asyncFn](https://raw.githubusercontent.com/team-igniter-from-houston-inc/async-fn/master/logo.png)

**[asyncFn](https://github.com/team-igniter-from-houston-inc/async-fn)** is a library that provides additional methods to [jest.fn](https://www.npmjs.com/package/@async-fn/jest) or [sinon.spy](https://www.npmjs.com/package/@async-fn/sinon) to introduce "**late resolve**" for the promises returned.

This simplifies async unit testing by allowing tests that read chronologically, **[like a story](https://medium.com/houston-io/how-to-unit-test-asynchronous-code-for-javascript-in-2020-41c124be2552)**.

asyncFn has zero non-native dependencies. It has **100% unit test coverage**, and 3+ years of focused **production use** with high **developer satisfaction**.

asyncFn is also **integration-tested** for combinations of recent OS-, node- and mocking framework -versions.

## How to install

```
$ npm install --save-dev @async-fn/jest
```

or

```
$ npm install --save-dev @async-fn/sinon
```

See more details for [jest](./packages/jest/README.md) or [sinon](./packages/sinon/README.md).

## Tutorial

See tutorial [here](https://medium.com/houston-io/how-to-unit-test-asynchronous-code-for-javascript-in-2020-41c124be2552).

## Examples

See examples for [jest](./packages/jest/README.md) or [sinon](./packages/sinon/README.md).

## Who are we?

asyncFn is lovingly crafted by Your pals at **Team: Igniter from [Houston Inc. Consulting](https://houston-inc.com)**.

We are a software development team of **friends**, with proven tradition in professional excellence. We specialize in holistic rapid deployments without sacrificing quality.

Come say hi at [Gitter](https://gitter.im/async-fn/community), [email](mailto:[email protected]) us, or check out the [team's website](https://team.igniter.houston.io). We just might be open to hiring ;)