From d24a98bbc65c9ae57f5c46dcaf529496c6558f8d Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Wed, 22 Feb 2017 15:40:47 +0100 Subject: [PATCH] Update: arrow functions simplified --- lib/copy/__tests__/copy.test.js | 4 +--- lib/json/__tests__/output-json-sync.test.js | 5 +---- lib/json/__tests__/output-json.test.js | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/copy/__tests__/copy.test.js b/lib/copy/__tests__/copy.test.js index 44695974..3e1cf92d 100644 --- a/lib/copy/__tests__/copy.test.js +++ b/lib/copy/__tests__/copy.test.js @@ -18,9 +18,7 @@ describe('fs-extra', () => { fse.emptyDir(TEST_DIR, done) }) - afterEach(done => { - fse.remove(TEST_DIR, done) - }) + afterEach(done => fse.remove(TEST_DIR, done)) describe('+ copy()', () => { it('should return an error if src and dest are the same', done => { diff --git a/lib/json/__tests__/output-json-sync.test.js b/lib/json/__tests__/output-json-sync.test.js index 6f706cef..aa2d77f2 100644 --- a/lib/json/__tests__/output-json-sync.test.js +++ b/lib/json/__tests__/output-json-sync.test.js @@ -36,10 +36,7 @@ describe('json', () => { const file = path.join(TEST_DIR, 'this-dir', 'does-not', 'exist', 'really', 'file.json') assert(!fs.existsSync(file)) - const replacer = (k, v) => { - if (v === 'JP') return 'Jon Paul' - return v - } + const replacer = (k, v) => v === 'JP' ? 'Jon Paul' : v const data = {name: 'JP'} outputJsonSync(file, data, { replacer }) diff --git a/lib/json/__tests__/output-json.test.js b/lib/json/__tests__/output-json.test.js index 14ece25c..03b4714a 100644 --- a/lib/json/__tests__/output-json.test.js +++ b/lib/json/__tests__/output-json.test.js @@ -39,10 +39,7 @@ describe('json', () => { const file = path.join(TEST_DIR, 'this-dir', 'does-not', 'exist', 'really', 'file.json') assert(!fs.existsSync(file)) - const replacer = (k, v) => { - if (v === 'JP') return 'Jon Paul' - return v - } + const replacer = (k, v) => v === 'JP' ? 'Jon Paul' : v const data = {name: 'JP'} outputJson(file, data, { replacer }, err => {