Skip to content

Commit 1f96b5d

Browse files
committed
fix(tests): "rejected promise … Error: No access"
Problem: Unhandled promise rejections in test logs: rejected promise not handled within 1 second: Error: No access stack trace: Error: No access at Context.<anonymous> (/…/src/test/credentials/auth.test.ts:325:49) rejected promise not handled within 1 second: Error: No access stack trace: Error: No access at Context.<anonymous> (/…/src/test/credentials/auth.test.ts:376:67) Solution: Catch the error.
1 parent 6803a43 commit 1f96b5d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ To run a single test in VSCode, do any one of:
176176
177177
- Unix/macOS/POSIX shell:
178178
```
179-
TEST_FILE=src/test/foo.test npm run test
179+
TEST_FILE=src/test/foo.test.ts npm run test
180180
```
181181
- Powershell:
182182
```
183-
$Env:TEST_FILE = "src/test/foo.test"; npm run test
183+
$Env:TEST_FILE = "src/test/foo.test.ts"; npm run test
184184
```
185185
186186
- To run all tests in a particular subdirectory, you can edit

src/auth/connection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ export async function* loadLinkedProfilesIntoStore(
300300

301301
const stream = client
302302
.listAccounts()
303+
.catch(e => {
304+
getLogger().error('listAccounts() failed: %s', (e as Error).message)
305+
return []
306+
})
303307
.flatten()
304308
.map(resp => {
305309
accounts.add(resp.accountId)

0 commit comments

Comments
 (0)