Skip to content

Commit

Permalink
Fix a LockFile test on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
iclanton committed Dec 10, 2024
1 parent 7633c0f commit c61a3c8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libraries/node-core-library/src/test/LockFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,13 @@ describe(LockFile.name, () => {

// create an open lockfile
const resourceName: string = 'test';
const lockFileName: string = LockFile.getLockFilePath(testFolder, resourceName);
const lockFileHandle: FileWriter = FileWriter.open(lockFileName, { exclusive: true });
const lockFileHandle: LockFile | undefined = LockFile.tryAcquire(testFolder, resourceName);
expect(lockFileHandle).toBeDefined();

const lock: LockFile | undefined = LockFile.tryAcquire(testFolder, resourceName);

// this lock should be undefined since there is an existing lock
expect(lock).toBeUndefined();
lockFileHandle.close();
lockFileHandle!.release();
});

test('can acquire and close a dirty lockfile', () => {
Expand Down

0 comments on commit c61a3c8

Please sign in to comment.