Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-describe

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-describe

function for running asynchronous tests

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

async-describe

A simple way for making async tests procedures

Installation
npm install --save-dev async-describe
API

async-describe is designed for running async end to end tests

describe(text, async fn)
  • describes block can be nested.
test(text, async fn)
  • cannot be nested in another test block.
  • should be used inside a describe block.
Example
const { describe, test } = require('async-describe');

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));

describe('tests', async () => {
  await describe('build client', async () => {
    await test('test');
  });
  await describe('start server', async () => {
    await test('test 1', async () => {
    })
    await test('test 2', async () => {
      console.warn('console.warn');
    })
    await test('test 3', sleep(1)) // test() can take a promise instead of an async function
    await sleep(100);
  });
  await describe('additional test I')
  await describe('additional test II', async () => {
    await test('test3', async () => {
      console.log('console.log');
    })
  })
  await describe('run functional tests', async () => {
    await sleep(100);
    await test('test4', async () => {
      throw new Error('1')
    })
    await test('test4', async () => {
      throw new Error('2')
    })
  });
  await describe('more test', async () => {
    throw new Error('Fatal')
  })
  await describe('more test')
  await describe('more test')
});

Keywords

FAQs

Package last updated on 20 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc