Skip to content

Commit

Permalink
Added isLocked test
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Jun 28, 2024
1 parent 5b299f1 commit 966a267
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/locked.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 966a267

Please sign in to comment.