grafana / k6-jslib-aws

Javascript Library allowing to interact with AWS resources from k6 scripts
Apache License 2.0
18 stars 29 forks source link

Type error with latest `@types/k6` version #115

Open fullheart opened 1 month ago

fullheart commented 1 month ago

Problem: The TS file src/internal/s3.ts has a type error with the latest @types/k6 package.

Version

Error message:

src/internal/s3.ts:200:13 - error TS2345: Argument of type 'string | ArrayBuffer' is not assignable to parameter of type 'string | bytes'.
  Type 'ArrayBuffer' is not assignable to type 'string | bytes'.
    Type 'ArrayBuffer' is missing the following properties from type 'number[]': length, pop, push, concat, and 28 more.

200             res.body
                ~~~~~~~~

Found 1 error in src/internal/s3.ts:200

How to reproduce?

git clone git@github.com:grafana/k6-jslib-aws.git
cd k6-jslib-aws/
git checkout v0.12.3
npm install --save-dev @types/k6 # Install latest `@types/k6` package
npx tsc -t es5 src/internal/s3.ts # See error output above
mstoykov commented 1 month ago

This has been fixed in the current master in b312325

cc @oleiade are we going to be releasing a version soon?