@smartthings/cli-testlib
TypeScript icon, indicating that this package has built-in type declarations

2.0.5 • Public • Published

@smartthings/cli-testlib

A library to support testing the SmartThings CLI and plugins written for it with Jest. It provides a setup file which stubs out various behavior (config loading, authentication, etc.) in the main CLI. This enables your test suite to start running commands quickly without worrying about these details.

Installation

npm i @smartthings/cli-testlib --save-dev

Usage

Edit your jest config to include setupFilesAfterEnv and specify it as shown.

module.exports = {
  setupFilesAfterEnv: ['@smartthings/cli-testlib'],
}

You can also extend/override the default setup script with one of your own as needed. (TODO: this may be required in some cases)

module.exports = {
	setupFilesAfterEnv: [
		'@smartthings/cli-testlib',
		'<rootDir>/jest.setup.ts'
	],
}

Readme

Keywords

none

Package Sidebar

Install

npm i @smartthings/cli-testlib

Weekly Downloads

2

Version

2.0.5

License

Apache-2.0

Unpacked Size

5.83 kB

Total Files

6

Last publish

Collaborators

  • john-u
  • workmonk
  • xres
  • bflorian
  • erode
  • smartthingspi
  • rossiam
  • jodyalbritton