Skip to content

Commit

Permalink
fix(test): await promise and check error (#1563)
Browse files Browse the repository at this point in the history
**Resolve ESLint Promise Handling Error**

Fixed the ESLint error by using `assert.rejects` to handle the promise
returned by `deviceCheater.setCurrentSpace`. This ensures that the
promise is properly managed and the test checks for expected rejections,
addressing the ESLint rule that requires promises to be awaited, handled
with `.catch`, or explicitly ignored.
  • Loading branch information
fforbeck authored Oct 14, 2024
1 parent 06fc93f commit 86e7a46
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/upload-api/test/access-client-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ export const test = {
)

// deviceCheater shouldn't have access to the space
deviceCheater.setCurrentSpace(space.did())
await assert.rejects(deviceCheater.setCurrentSpace(space.did()), {
name: 'Error',
message: `Agent has no proofs for ${space.did()}.`,
})

// deviceCheater tries to craft a delegation to gain access to the account
const unattestedDelegation = await Top.top.delegate({
Expand Down

0 comments on commit 86e7a46

Please sign in to comment.