Closed joekaiser closed 3 years ago
Hi @joekaiser will guid work for random string?
Absolutely
I would imagine integers could even work. The need is for random data. At the end of the test the record is delete, so it doesn't matter what it is.
That’s Good, if possible I will include this for next update
I saw faker.js the size is around 6MB , which is too big to use. I will check the other one.
Any ultra lightweight library?
@rangav actually faker
is around 9.6MB PUBLISH SIZE & INSTALL SIZE however it's very huge because of the international data names (ar,fr,en,it,....) for chancejs
1.80MB PUBLISH SIZE & INSTALL SIZE with limited data and limited api compared to chancejs
, you can remove the additional European the idea here is to keep only the main typography such as [en,it,es,...]=> latina and [ar,pr]=>ar and Chinese , only the main different characters.
I'm not suggesting how to build your product, but I don't see real fake data as something useful. I would imagine a string RNG number or UUID would solve 90%+ of all use cases
Hi all, started working on this, initially supports following variables
UPDATE: format will {{#randomString}}, hash # prefix and variable name
let me know your feedback.
Planning to release new update by end of today.
Update: the underscore prefix is sometimes clearly not visible so changing the prefix to #
the new format will {{#randomString}}
This feature is now implemented in v1.3.0 https://github.com/rangav/thunder-client-support/releases/tag/1.3.0 Let me know if any questions.
Docs Link https://github.com/rangav/thunder-client-support#variables
Is your feature request related to a problem? Please describe. Assume testing the CRUD lifecycle of a rest API. You need to be able to create/update/fetch/delete an entity. It would be nice if Thunder Client could generate random strings and integers to use in the request body.
Describe the solution you'd like Let's take the Create example. The request requires a
name:string
to be passed over. Perhaps you can do something similar to how environment variables are used.{{__randstring}}
, maybe?Describe alternatives you've considered An Alternative could be having "setups" as part of the request. Similar to how Tests work you can manipulate environment variables, and set the value to something random there. This way you can just use the environment variable as normal, but the value would change with every request.
Implementation: