From 966a267b882a84b535695dfe8beb8303f2ae2800 Mon Sep 17 00:00:00 2001 From: "James P." Date: Fri, 28 Jun 2024 13:46:58 -0500 Subject: [PATCH] Added `isLocked` test --- tests/locked.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/locked.test.ts b/tests/locked.test.ts index 077ca951..7316e1cd 100644 --- a/tests/locked.test.ts +++ b/tests/locked.test.ts @@ -3,12 +3,13 @@ import { InMemory } from '../src/backends/memory.js'; import { LockedFS } from '../src/backends/locked.js'; describe('LockFS mutex', () => { - const fs = new LockedFS(InMemory.create({ name: 'test' })); test('lock/unlock', () => { fs.lockSync('/test'); + expect(fs.isLocked('/test')).toBe(true); fs.unlock('/test'); + expect(fs.isLocked('/test')).toBe(false); }); test('queueing multiple locks', async () => {