Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
fix(deps): update dependency fast-xml-parser to v3.21.1 (#442)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency fast-xml-parser to v3.21.1

* test: fix

* test: fix build type error

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Roman <491247+moltar@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 10, 2021
1 parent 97d378b commit 49fc7eb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -48,7 +48,7 @@
"dependencies": {
"@scaleleap/amazon-marketplaces": "13.0.0",
"axios": "0.21.4",
"fast-xml-parser": "3.20.3",
"fast-xml-parser": "3.21.1",
"html-entities": "2.3.2",
"purify-ts": "1.1.0",
"ts-error": "1.0.6"
Expand Down
40 changes: 19 additions & 21 deletions test/unit/http.test.ts
Expand Up @@ -54,25 +54,25 @@ describe('httpClient', () => {
it('should throw a HttpError that can be handled', async () => {
expect.assertions(7)

const httpClient = httpClientThatThrows(getFixture('error_response'))

let expectedError!: InvalidParameterValueError

try {
await httpClient.request('POST', mockRequest)
} catch (error) {
expectedError = error
const getError = async () => {
const httpClient = httpClientThatThrows(getFixture('error_response'))
try {
await httpClient.request('POST', mockRequest)
throw new Error('NoErrorThrownError')
} catch (error: unknown) {
return error as InvalidParameterValueError
}
}

expect(expectedError instanceof MWSError).toStrictEqual(true)
expect(expectedError instanceof HttpError).toStrictEqual(true)
expect(expectedError instanceof InvalidParameterValueError).toStrictEqual(true)
expect(expectedError.code).toStrictEqual('InvalidParameterValue')
expect(expectedError.type).toStrictEqual('Sender')
expect(expectedError.requestId).toStrictEqual('e26147f9-30cc-4379-9fb5-bd4ad966c48b')
expect(expectedError.mwsMessage).toStrictEqual(
'CreatedAfter or LastUpdatedAfter must be specified',
)
const error = await getError()

expect(error instanceof MWSError).toStrictEqual(true)
expect(error instanceof HttpError).toStrictEqual(true)
expect(error instanceof InvalidParameterValueError).toStrictEqual(true)
expect(error.code).toStrictEqual('InvalidParameterValue')
expect(error.type).toStrictEqual('Sender')
expect(error.requestId).toStrictEqual('e26147f9-30cc-4379-9fb5-bd4ad966c48b')
expect(error.mwsMessage).toStrictEqual('CreatedAfter or LastUpdatedAfter must be specified')
})

it('should propagate non-API errors', async () => {
Expand Down Expand Up @@ -511,10 +511,8 @@ describe('httpClient', () => {
}),
),
)
await expect(() => mockFXPValidationFail.sellers.getServiceStatus()).rejects.toStrictEqual(
new ParsingError(
"Closing tag 'StartTagWithoutClosing' is expected inplace of 'StartTagWithClosing'.",
),
await expect(() => mockFXPValidationFail.sellers.getServiceStatus()).rejects.toThrow(
ParsingError,
)
})
})
Expand Down

0 comments on commit 49fc7eb

Please sign in to comment.