Fix tests

This commit is contained in:
Andras Schmelczer 2025-08-17 15:01:45 +01:00
parent 2d016c44bd
commit b7e80c39f1
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 2 additions and 2 deletions

View file

@ -35,7 +35,7 @@ describe("Document lock", () => {
test("should throw an error when unlocking a document that is not locked", () => {
expect(() => {
locks.unlock(testPath);
}).toThrow(`Document ${testPath} is not locked, cannot unlock`);
}).toThrow(`Key '${testPath}' is not locked, cannot unlock`);
});
test("should wait for a document lock and resolve when unlocked", async () => {

View file

@ -67,7 +67,7 @@ export class Locks<T> {
*/
public unlock(key: T): void {
if (!this.locked.has(key)) {
throw new Error(`Key ${key} is not locked, cannot unlock`);
throw new Error(`Key '${key}' is not locked, cannot unlock`);
}
// Remove first waiter to ensure FIFO order