From b6cb6a0fa774152f737821fc3f14ca972ced4666 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Sat, 24 Aug 2024 02:37:36 +0200 Subject: [PATCH] refactor: test --- test/async.ts | 9 +-------- test/sync.ts | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) 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() })