From d38cabda0571286a96ec64ef6e85c1955215276d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2020 22:25:14 +0800 Subject: [PATCH] chore(deps-dev): eslint-config-hexo from 3.0.0 to 4.1.0 (#156) * Bump eslint-config-hexo from 3.0.0 to 4.1.0 Bumps [eslint-config-hexo](https://github.com/hexojs/eslint-config-hexo) from 3.0.0 to 4.1.0. - [Release notes](https://github.com/hexojs/eslint-config-hexo/releases) - [Commits](https://github.com/hexojs/eslint-config-hexo/compare/3.0.0...4.1.0) Signed-off-by: dependabot-preview[bot] * style: update with latest eslint-config-hexo Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: SukkaW --- lib/deployer.js | 4 ++-- lib/parse_config.js | 4 ++-- package.json | 2 +- test/parse_config.js | 48 ++++++++++++++++++++++---------------------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/deployer.js b/lib/deployer.js index c9cf67e..0d1f3f6 100644 --- a/lib/deployer.js +++ b/lib/deployer.js @@ -83,7 +83,7 @@ module.exports = function(args) { }); } - return fs.exists(deployDir).then(function(exist) { + return fs.exists(deployDir).then(exist => { if (exist) return; log.info('Setting up Git deployment...'); @@ -143,7 +143,7 @@ module.exports = function(args) { }); }).then(() => { return parseConfig(args); - }).each(function(repo) { + }).each(repo => { return push(repo); }); }; diff --git a/lib/parse_config.js b/lib/parse_config.js index 8a09bcd..08a79d7 100644 --- a/lib/parse_config.js +++ b/lib/parse_config.js @@ -7,7 +7,7 @@ const { URL } = require('url'); function parseObjRepo(repo) { let url = repo.url; let branch = repo.branch; - let configToken = repo.token; + const configToken = repo.token; if (!branch) { branch = testBranch(url); @@ -43,7 +43,7 @@ function parseObjRepo(repo) { function parseStrRepo(repo) { const split = repo.split(','); - let url = split.shift(); + const url = split.shift(); let branch = split[0]; if (!branch) { diff --git a/package.json b/package.json index 98a0121..ec62e96 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "devDependencies": { "chai": "^4.2.0", "eslint": "^6.1.0", - "eslint-config-hexo": "^3.0.0", + "eslint-config-hexo": "^4.1.0", "mocha": "^7.1.2", "nyc": "^15.0.0" }, diff --git a/test/parse_config.js b/test/parse_config.js index 5276355..1e3a65b 100644 --- a/test/parse_config.js +++ b/test/parse_config.js @@ -2,11 +2,11 @@ var should = require('chai').should(); // eslint-disable-line -describe('parse config', function() { - var parseConfig = require('../lib/parse_config'); +describe('parse config', () => { + const parseConfig = require('../lib/parse_config'); - it('single repo, no branch', function() { - var result = parseConfig({ + it('single repo, no branch', () => { + const result = parseConfig({ repo: 'https://example.com/path/to/repo.git' }); @@ -15,8 +15,8 @@ describe('parse config', function() { ]); }); - it('single repo, with branch', function() { - var result = parseConfig({ + it('single repo, with branch', () => { + const result = parseConfig({ repo: 'https://example.com/path/to/repo.git', branch: 'develop' }); @@ -26,8 +26,8 @@ describe('parse config', function() { ]); }); - it('single repo, branch after url', function() { - var result = parseConfig({ + it('single repo, branch after url', () => { + const result = parseConfig({ repo: 'https://example.com/path/to/repo.git,develop' }); @@ -36,8 +36,8 @@ describe('parse config', function() { ]); }); - it('multiple repo', function() { - var result = parseConfig({ + it('multiple repo', () => { + const result = parseConfig({ repo: { foo: 'https://example.com/path/to/repo.git', bar: 'https://example.com/path/to/repo2.git,custom' @@ -50,7 +50,7 @@ describe('parse config', function() { ]); }); - it('github repo, master branch', function() { + it('github repo, master branch', () => { // https parseConfig({ repo: 'https://github.com/hexojs/hexojs.github.io.git' @@ -67,7 +67,7 @@ describe('parse config', function() { })[0].branch.should.eql('master'); }); - it('github repo, gh-pages branch', function() { + it('github repo, gh-pages branch', () => { // https parseConfig({ repo: 'https://github.com/hexojs/hexo.git' @@ -84,14 +84,14 @@ describe('parse config', function() { })[0].branch.should.eql('gh-pages'); }); - it('github repo, custom branch', function() { + it('github repo, custom branch', () => { parseConfig({ repo: 'https://github.com/hexojs/hexojs.github.io.git', branch: 'site' })[0].branch.should.eql('site'); }); - it('coding repo, coding-pages branch', function() { + it('coding repo, coding-pages branch', () => { // https parseConfig({ repo: 'https://coding.net/hexojs/hexojs.git' @@ -108,14 +108,14 @@ describe('parse config', function() { })[0].branch.should.eql('coding-pages'); }); - it('coding, custom branch', function() { + it('coding, custom branch', () => { parseConfig({ repo: 'https://coding.net/hexojs/hexojs.git', branch: 'site' })[0].branch.should.eql('site'); }); - it('repo is required', function() { + it('repo is required', () => { try { parseConfig({}); } catch (err) { @@ -123,7 +123,7 @@ describe('parse config', function() { } }); - it('single repo with plain text token', function() { + it('single repo with plain text token', () => { // http parseConfig({ repo: { @@ -141,7 +141,7 @@ describe('parse config', function() { })[0].url.should.eql('git://github.com/hexojs/hexojs.github.io.git'); }); - it('single repo with env var token', function() { + it('single repo with env var token', () => { process.env.GIT_TOKEN = 'env_token'; // http @@ -163,7 +163,7 @@ describe('parse config', function() { delete process.env.GIT_TOKEN; }); - it('Structured single repo setting', function() { + it('Structured single repo setting', () => { parseConfig({ repo: { url: 'https://coding.net/hexojs/hexojs.git', @@ -172,7 +172,7 @@ describe('parse config', function() { })[0].branch.should.eql('site'); }); - it('Single repo setting with name', function() { + it('Single repo setting with name', () => { parseConfig({ repo: { my_repo: 'https://coding.net/hexojs/hexojs.git,site' @@ -180,7 +180,7 @@ describe('parse config', function() { })[0].branch.should.eql('site'); }); - it('Single structured repo setting with name', function() { + it('Single structured repo setting with name', () => { parseConfig({ repo: { my_repo: { @@ -191,7 +191,7 @@ describe('parse config', function() { })[0].branch.should.eql('site'); }); - it('Structured multiple repo settings', function() { + it('Structured multiple repo settings', () => { process.env.GIT_TOKEN = 'env_token'; const result = parseConfig({ repo: { @@ -220,7 +220,7 @@ describe('parse config', function() { delete process.env.GIT_TOKEN; }); - it('fail to read env var token', function() { + it('fail to read env var token', () => { // http try { @@ -235,7 +235,7 @@ describe('parse config', function() { } }); - it('invalid url', function() { + it('invalid url', () => { try { parseConfig({ repo: {