Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump eslint-config-hexo from 3.0.0 to 4.1.0 #156

Merged
merged 2 commits into from Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/deployer.js
Expand Up @@ -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...');
Expand Down Expand Up @@ -143,7 +143,7 @@ module.exports = function(args) {
});
}).then(() => {
return parseConfig(args);
}).each(function(repo) {
}).each(repo => {
return push(repo);
});
};
Expand Down
4 changes: 2 additions & 2 deletions lib/parse_config.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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"
},
Expand Down
48 changes: 24 additions & 24 deletions test/parse_config.js
Expand Up @@ -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'
});

Expand All @@ -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'
});
Expand All @@ -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'
});

Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -108,22 +108,22 @@ 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) {
err.should.have.property('message', 'repo is required!');
}
});

it('single repo with plain text token', function() {
it('single repo with plain text token', () => {
// http
parseConfig({
repo: {
Expand All @@ -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
Expand All @@ -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',
Expand All @@ -172,15 +172,15 @@ 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'
}
})[0].branch.should.eql('site');
});

it('Single structured repo setting with name', function() {
it('Single structured repo setting with name', () => {
parseConfig({
repo: {
my_repo: {
Expand All @@ -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: {
Expand Down Expand Up @@ -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 {
Expand All @@ -235,7 +235,7 @@ describe('parse config', function() {
}
});

it('invalid url', function() {
it('invalid url', () => {
try {
parseConfig({
repo: {
Expand Down