Skip to content

Commit 902b7dc

Browse files
committed
fix(tests): "rejected promise … FileSystemError … big-image.jpg"
Problem: Unhandled promise rejection in test logs: rejected promise not handled within 1 second: AssertionError (FileSystemError): No file found for key "big-image.jpg" stack trace: AssertionError (FileSystemError): No file found for key "big-image.jpg" at Function.e (/…/.vscode-test/vscode-linux-x64-1.85.1/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:143:27896) The tests that open the `bigImage` file don't actually care about its content (and thus didn't fail); when the provider (asynchronously, later) tries to load the file, it gets an error. Solution: Add the file to the fake storage service, via `s3.addFile()`.
1 parent 3855424 commit 902b7dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/s3/util/fileViewerManager.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ describe('FileViewerManager', function () {
204204
})
205205

206206
disposables = registerFileSystemProviders()
207+
208+
const bigImageFile = makeFile('big-image.jpg', Buffer.from('fake image', 'utf-8'))
209+
s3.addFile(bigImageFile)
207210
})
208211

209212
afterEach(async function () {

0 commit comments

Comments
 (0)