question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI Test command should recognize block tags + plugins

See original GitHub issue

Describe 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:

  1. In Insomnia designer -> Application -> Preferences - Plugins, install the “insomnia-plugin-randomnumber” package
  2. In the “DEBUG” tab of the insomnia designer, create a new request that makes use of this plugin
  3. In the “TEST” tab of the insomnia designer, create a simple “Returns 200” test
  4. 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 image

image

image

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
coladarcicommented, Mar 25, 2021

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!

1reaction
develohpandacommented, Aug 13, 2020

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. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to apply Tags to your Cypress Tests like Smoke, E2E
Step 1: Install the cypress-select-tests plugin using the command: ... to execute only tests with the 'E2E' tag we will use the command: ......
Read more >
CLI Commands for Dynamic IP Addresses and Tags
CLI Commands for Dynamic IP Addresses and Tags ; Add or delete tags for a given IP address that was registered using the...
Read more >
list-plugins — AWS CLI 1.27.32 Command Reference
list-plugins is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can...
Read more >
Command Line Interface | API | Docs - TestCafe
To run tests in cloud browsers or other browsers accessed through a browser provider plugin, specify the browser's alias that consists of the...
Read more >
WP-CLI – The command line interface for WordPress
Allow plugin/theme enumeration without forcing an update check. Previously, when you run plugin list or theme list , WP-CLI would automatically run a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found