Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
forked from serverless/test

Test setup and utilities for serverless projects

License

Notifications You must be signed in to change notification settings

FormidableLabs/serverless-test

 
 

Repository files navigation

@serverless/test

Internal test utils that aid Serverless organization libraries

Provides a reliable test suite setup, based on Mocha test framework

Installation

npm i --save-dev mocha@6 chai chai-as-promised @serverless/test

Mocha Setup

Preconfigure Mocha to rely on a custom reporter, included with this package, which applies workarounds for known Mocha issues, and exposes endpoint through which other utils may observe Mocha runner flow.

In package.json add mocha section with reporter option set, and recommended extensions as follows:

{
  "mocha": {
    "reporter": "@serverless/test/setup/mocha-reporter",
    "require": [
      "@serverless/test/setup/log",
      "@serverless/test/setup/async-leaks-detector",
      "@serverless/test/setup/mock-homedir",
      "@serverless/test/setup/restore-cwd",
      "@serverless/test/setup/restore-env"
    ]
  }
}

Setup extensions

All setup extensions are documented in docs/setup folder

Utils

All utils are documented in docs folder

Binaries

All binaries are documented in docs/bin folder

About

Test setup and utilities for serverless projects

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%