From a34ad06633bdfb57d3aff17d905ba0409fcbb3fd Mon Sep 17 00:00:00 2001 From: segayuu Date: Tue, 25 Feb 2020 22:28:31 +0900 Subject: [PATCH] fix(lint): fix lint error "require-atomic-updates" --- test/scripts/console/config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/scripts/console/config.js b/test/scripts/console/config.js index bf668726a5..67e3248eb6 100644 --- a/test/scripts/console/config.js +++ b/test/scripts/console/config.js @@ -107,14 +107,14 @@ describe('config', () => { await writeFile(configPath, '{}'); await config({_: ['title', 'My Blog']}); - const content = await readFile(configPath); + return readFile(configPath).then(content => { + const json = JSON.parse(content); - const json = JSON.parse(content); + json.title.should.eql('My Blog'); - json.title.should.eql('My Blog'); - - hexo.config_path = join(hexo.base_dir, '_config.yml'); - return unlink(configPath); + hexo.config_path = join(hexo.base_dir, '_config.yml'); + return unlink(configPath); + }); }); it('create config if not exist', async () => {