diff --git a/test/async.ts b/test/async.ts index 8e288c7..454fd69 100644 --- a/test/async.ts +++ b/test/async.ts @@ -48,14 +48,7 @@ test('do not fail if correct target folder already exists', async (t) => { await fs.mkdir('src') await symlink('src', 'dest', { overwrite: false }) - let err!: Error - try { - await symlink('src', 'dest', { overwrite: false }) - } catch (_err) { - err = _err - } - - t.equals(err, undefined) + t.equal((await symlink('src', 'dest', { overwrite: false })).reused, true) t.end() }) diff --git a/test/sync.ts b/test/sync.ts index 050c746..79c930d 100644 --- a/test/sync.ts +++ b/test/sync.ts @@ -48,14 +48,7 @@ test('do not fail if correct target folder already exists', async (t) => { await fs.mkdir('src') symlink.sync('src', 'dest', { overwrite: false }) - let err!: Error - try { - symlink.sync('src', 'dest', { overwrite: false }) - } catch (_err) { - err = _err - } - - t.equals(err, undefined) + t.equals(symlink.sync('src', 'dest', { overwrite: false }).reused, true) t.end() })