I've found that the simple XML parser util doesn't handle self-closing tags properly, so for a response like this:
Example
<?xml version='1.0' encoding='UTF-8'?>
<ListVersionsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>bucket</Name>
<Prefix/>
<KeyMarker/>
<VersionIdMarker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Version>
<Key>file1.jpg</Key>
<VersionId>1781648073.939709</VersionId>
<IsLatest>true</IsLatest>
<LastModified>2026年06月16日T22:14:34.000Z</LastModified>
<Size>26702</Size>
<Owner>
<ID>user</ID>
<DisplayName>user</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Version>
<Version>
<Key>file2.mp4</Key>
<VersionId>1781648486.233691</VersionId>
<IsLatest>true</IsLatest>
<LastModified>2026年06月16日T22:21:26.000Z</LastModified>
<Size>3217865</Size>
<Owner>
<ID>user</ID>
<DisplayName>user</DisplayName>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Version>
</ListVersionsResult>
it would produce completely borked json
| Before | After |
|---|---|
|
|
I've also added some tests.
test:unit was using the default jest.config.js, so I've created a separate config so that
- you don't need to set provider env variables to run it (seems like
jest.config.jsis meant mostly fortest:providers?) - you can import source files in tests directly