@serverless/test

11.1.1 • Public • Published

@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@9 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": {
    "require": [
      "@serverless/test/setup/patch",
      "@serverless/test/setup/log",
      "@serverless/test/setup/mock-homedir",
      "@serverless/test/setup/mock-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

Readme

Keywords

Package Sidebar

Install

npm i @serverless/test

Weekly Downloads

1,557

Version

11.1.1

License

MIT

Unpacked Size

117 kB

Total Files

55

Last publish

Collaborators

  • serverless-main