Open StephanMeijer opened 1 month ago
In my test I am using nodeToFsa^2 in order to 'mock' the Origin Private File System (OPFS)^6 API's that are available in the browser.
nodeToFsa
Application logic and tests can be found here.^1
In OriginPrivateFileSystemStorage.load I am calling fileHandle.getFile()^3. The expectation is that this function^3 returns Promise<File>. Promise<File> was returned but the .text()^4 method on File^5 seems not to be properly implemented..
OriginPrivateFileSystemStorage.load
fileHandle.getFile()
Promise<File>
.text()
File
$ git checkout git@gitlab.com:toegang-voor-iedereen/frontend/editor-app.git # or $ git checkout https://gitlab.com/toegang-voor-iedereen/frontend/editor-app.git
$ git checkout feature/NLD-264-opfs-memfs-issue
$ npm ci
$ npm run test -- src/storage/OriginPrivateFileSystemStorage.spec.ts
$ npm list | grep memfs memfs@4.14.0 $ npm -v 10.8.2 $ node -v v22.8.0
Cause
In my test I am using
nodeToFsa
^2 in order to 'mock' the Origin Private File System (OPFS)^6 API's that are available in the browser.Application logic and tests can be found here.^1
In
OriginPrivateFileSystemStorage.load
I am callingfileHandle.getFile()
^3. The expectation is that this function^3 returnsPromise<File>
.Promise<File>
was returned but the.text()
^4 method onFile
^5 seems not to be properly implemented..Reproduction
$ git checkout feature/NLD-264-opfs-memfs-issue
$ npm ci
$ npm run test -- src/storage/OriginPrivateFileSystemStorage.spec.ts
Versions