You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably less a bug and more a testimony of my lack of understanding. First of all: LOVE your work!
I'm trying to understand kdbxweb, so I setup a simple project that creates, saves and loads a database. Works like a charm in the browser (run npm run dev to see). However I failed to create a unit test using vitest. Creation works, but save fails:
TypeError: Failed to execute 'digest' on 'SubtleCrypto': 2nd argument is not instance of ArrayBuffer, Buffer, TypedArray, or DataView.
The test method looks like this:
import{describe,it,expect,beforeEach,afterEach}from'vitest';import{init,createDatabase,saveDatabase,loadDatabase,clearDatabase}from'../src/vault';import*askdbxwebfrom'kdbxweb';describe('Vault Kxdb Tests',()=>{beforeEach(()=>{init();});afterEach(()=>{clearDatabase();});it('should create a new database',async()=>{constdb=awaitcreateDatabase('test');expect(db).toBeDefined();});it('should save the database',async()=>{constdb=awaitcreateDatabase('test');constarrayBuffer=awaitsaveDatabase(db);expect(arrayBuffer).toBeDefined();});it('should load the database',async()=>{constdb=awaitcreateDatabase('test');constarrayBuffer=awaitsaveDatabase(db);constloadedDb=awaitloadDatabase(arrayBuffer,'test');expect(loadedDb).toBeDefined();});});
This is probably less a bug and more a testimony of my lack of understanding. First of all: LOVE your work!
I'm trying to understand kdbxweb, so I setup a simple project that creates, saves and loads a database. Works like a charm in the browser (run
npm run dev
to see). However I failed to create a unit test using vitest. Creation works, but save fails:The test method looks like this:
full project here: https://github.com/Stwissel/kxdbtest
What do I miss?
The text was updated successfully, but these errors were encountered: