@smartthings/cli-testlib
v2.0.7
Published
SmartThings CLI testing utility methods library
Downloads
5,026
Keywords
Readme
@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'
],
}