Skip to content

Commit

Permalink
fix(tests): fix issue in character tests where strings were being tre…
Browse files Browse the repository at this point in the history
…ated as arrays
  • Loading branch information
ReidWeb committed Jan 2, 2022
1 parent d5d8163 commit 40f49e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/api/classes/client_LodestoneClient.default.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Client for interfacing with the Final Fantasy XIV Lodestone.

#### Defined in

[client/LodestoneClient.ts:56](https://github.com/XIVStats/lodestone/blob/8f23137/src/client/LodestoneClient.ts#L56)
[client/LodestoneClient.ts:56](https://github.com/XIVStats/lodestone/blob/d5d8163/src/client/LodestoneClient.ts#L56)

## Properties

Expand All @@ -44,4 +44,4 @@ An instance will be generated by default, but as a consumer you can provide your

#### Defined in

[client/LodestoneClient.ts:50](https://github.com/XIVStats/lodestone/blob/8f23137/src/client/LodestoneClient.ts#L50)
[client/LodestoneClient.ts:50](https://github.com/XIVStats/lodestone/blob/d5d8163/src/client/LodestoneClient.ts#L50)
18 changes: 13 additions & 5 deletions src/entity/__tests__/Character.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,11 +422,19 @@ describe('Character', () => {
if (objectAttributes.length > 0) {
describe.each(objectAttributes)('should evaluate %s as object', (key, value) => {
describe.each(Object.entries(value))('with key %s, an object', (lowerKey, lowerValue) => {
// @ts-ignore
it.each(Object.entries(lowerValue))("with key %s equal to '%s'", (lowestKey, lowestValue) => {
// @ts-ignore
expect(resultantCharacter[key][lowerKey][lowestKey]).toEqual(lowestValue)
})
if (!(lowerValue instanceof Object)) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
it(`with key ${lowerKey} equal to ${lowerValue}`, ()=>{
// @ts-ignore
expect(resultantCharacter[key][lowerKey]).toEqual(lowerValue)
})
} else {
// @ts-ignore
it.each(Object.entries(lowerValue))("with key %s equal to '%s'", (lowestKey, lowestValue) => {
// @ts-ignore
expect(resultantCharacter[key][lowerKey][lowestKey]).toEqual(lowestValue)
})
}
})
})
}
Expand Down

0 comments on commit 40f49e6

Please sign in to comment.