A library to support testing the SmartThings CLI and plugins written for it with Jest.
We provide a setup file which stubs out various init hook behavior (config loading, authentication, etc.) in the main CLI. This enables your test suite to start running commands quickly without worrying about these details.
- Copy (and rename) jest.setup.ts.example to a desired location in your project root.
- Edit your jest config to include setupFiles and specify the path to the previously copied setup file. See example jest config below.
module.exports = {
setupFilesAfterEnv: [
'<rootDir>/jest.setup.ts'
],
}