From c0cdea2e86ea28acff66ac1194fc45debfee0d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Tue, 2 Apr 2019 18:00:30 +0100 Subject: [PATCH] chore: fix error message Closes #85 --- lib/lockfile.js | 2 +- test/sync.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lockfile.js b/lib/lockfile.js index 2078e82..3cd769b 100644 --- a/lib/lockfile.js +++ b/lib/lockfile.js @@ -51,7 +51,7 @@ function acquireLock(file, options, callback) { } if (!isLockStale(stat, options)) { - return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file })); + return callback(Object.assign(new Error('Lock file is already being held'), { code: 'ELOCKED', file })); } // If it's stale, remove it and try again! diff --git a/test/sync.test.js b/test/sync.test.js index 7a3afd2..53d7b2c 100644 --- a/test/sync.test.js +++ b/test/sync.test.js @@ -37,7 +37,7 @@ describe('.lockSync()', () => { lockfile.lockSync(`${tmpDir}/foo`); expect(fs.existsSync(`${tmpDir}/foo.lock`)).toBe(true); - expect(() => lockfile.lockSync(`${tmpDir}/foo`)).toThrow(/already being hold/); + expect(() => lockfile.lockSync(`${tmpDir}/foo`)).toThrow(/already being held/); }); it('should pass options correctly', () => {