-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken scripts after v0.12.2 -> v0.17.0 upgrade #287
Comments
Hi @NuSkooler. I've updated the Slack invite link now on k6.io: https://k6.io/slack/, sorry about that. Regarding the issues you've encountered:
I've used the following snippet personally while waiting for
I'm not sure I fully understand the reason for using
|
@robingustafsson Thank you very much for your quick response! The I had a typo in my Perhaps this will illustrate why I've been using that approach:
What I get out of this vs using If there is a better approach that is similar in it's lazy handed approach (DRY!), I'd love to hear it! |
FWIW, I resorted to something like this until better advised:
|
Hm, from what I'm getting, you basically want to access a member in a JSON payload and not have to check if the path exists, right? What if we added a function for doing that instead, like |
@liclac Basically yes. Longer version:
I think having lodash / external libraries importing working well I could just |
Yeah, it's cached. I think a helper function may be the best way to go about it for if you don't wanna check if it's actually a JSON response, but imo we should offer a |
I'm closing this for now, could you open another issue for a |
First off, apologies for using an issue for questions - the Slack invite linked on k6.io states that it is no longer valid.
I have a working script created with v0.12.2. Upon upgrading to v0.17.0 there are three major issues:
import { checkGet, checkPost, checkAuthenticate } from './general';
has to be changed toimport { checkGet, checkPost, checkAuthenticate } from './general.js';
(note the .js)Object.assign
now results inTypeError: Object has no member 'assign
json_body
member ofres
(code below). The reason for doing this vs usingres.json()
is it makes it convenient to have a default empty {} object so downstream checks can validate against it. With.json()
those checks would fail. This now results inTypeError: Cannot assign to property json_body of a host object
however. Example:Please advise on alternatives/workarounds!
The text was updated successfully, but these errors were encountered: