CLI Test command should recognize block tags + plugins
See original GitHub issueDescribe the bug I am using the “Random Number” plugin in the Insomnia Designer. This tag is used in a few places in my unit test execution. When running the tests through the Insomnia Designer all my tests pass without a problem, but when I use the CLI to run the tests, I get a “Error: unknown block tag: randomnumber”.
I am making use of the git sync feature and are running the cli tests from within the repo folder on my local machine. I also installed the plugin in this folder using npm i insomnia-plugin-randomnumber
.
My test payload is as follow:
{
"name": "User Name",
"age": "{% randomnumber 10, 99, 0, 0 %}"
}
To Reproduce Steps to reproduce the behavior:
- In Insomnia designer -> Application -> Preferences - Plugins, install the “insomnia-plugin-randomnumber” package
- In the “DEBUG” tab of the insomnia designer, create a new request that makes use of this plugin
- In the “TEST” tab of the insomnia designer, create a simple “Returns 200” test
- Using the inso CLI, run the newly created test and you will get the error:
Error: unknown block tag: randomnumber
at C:\Users\{USERNAME}\AppData\Roaming\npm\node_modules\insomnia-inso\node_modules\insomnia-send-request\dist\index.js:6343:26
at C:\Users\{USERNAME}\AppData\Roaming\npm\node_modules\insomnia-inso\node_modules\nunjucks\src\environment.js:39:5
at RawTask.call (C:\Users\{USERNAME}\AppData\Roaming\npm\node_modules\insomnia-inso\node_modules\asap\asap.js:40:19)
at flush (C:\Users\{USERNAME}\AppData\Roaming\npm\node_modules\insomnia-inso\node_modules\asap\raw.js:50:29)
at processTicksAndRejections (internal/process/task_queues.js:76:11)
Expected behavior When using insomnia plugins, the CLI should be able to utilise them in unit tests
Screenshots
Desktop (please complete the following information):
- OS: Windows 10 Pro V1809 (Build: 17763.1339)
- Installation Method: npm
- CLI Version: 2.2.20
- Node Version: 12.14.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top GitHub Comments
We are debating re-writing all automation to use inso, but we make heavy use of
jwtCreate
and have seen the error described here. Is this officially on the roadmap or is it still up in the air? Thanks!Thanks @Ruan20795, this is a valid use case and should be supported. This initial stage of the CLI does not play with plugins, so I’ve marked this as a feature request instead of a bug. We need to give some thought towards how to communicate plugin information through to the CLI. 👍