Brief summary
The documentation and typings for setInputFiles is wrong twice
k6 version
v0.57.0
OS
all
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Create any k6 script in Typescript with types provided by the @types/k6 package. The File interface from the k6/browser has two incorrect typings:
- The mime type parameter is named in camel case (
mimeType) but k6 actually expects all lowercase mimetype
- The
buffer parameter is typed as ArrayBuffer but string containing the base64 encoded data is expected
(The sample script in the documentation is actually correct btw)
Expected behaviour
The typings/documentation match and everything works.
Actual behaviour
You get either errors from the typescript compiler (due to mismatch ArrayBuffer vs string or mimeType vs mimetype) or issues during test execution (exceptions when the injected script tries to decode the ArrayBuffer with atob or missing mime type)
Brief summary
The documentation and typings for setInputFiles is wrong twice
k6 version
v0.57.0
OS
all
Docker version and image (if applicable)
No response
Steps to reproduce the problem
Create any k6 script in Typescript with types provided by the
@types/k6package. TheFileinterface from thek6/browserhas two incorrect typings:mimeType) but k6 actually expects all lowercasemimetypebufferparameter is typed asArrayBufferbut string containing the base64 encoded data is expected(The sample script in the documentation is actually correct btw)
Expected behaviour
The typings/documentation match and everything works.
Actual behaviour
You get either errors from the typescript compiler (due to mismatch
ArrayBuffervsstringormimeTypevsmimetype) or issues during test execution (exceptions when the injected script tries to decode the ArrayBuffer withatobor missing mime type)