Skip to content

Commit

Permalink
Merge pull request #110 from YoshinoriN/update-vulnerabilities-depend…
Browse files Browse the repository at this point in the history
…encies

Update vulnerabilities dependencies
  • Loading branch information
segayuu authored Oct 12, 2018
2 parents 4a2e283 + de9fadb commit e6414bb
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 101 deletions.
4 changes: 0 additions & 4 deletions .jscsrc

This file was deleted.

1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ before_script:

script:
- npm run eslint
- npm run jscs
- npm run test-cov

after_script:
Expand Down
2 changes: 1 addition & 1 deletion lib/parse_config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var rRepoURL = /^(?:(?:git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/;
var rRepoURL = /^(?:(?:git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/; // eslint-disable-line no-useless-escape
var rGithubPage = /\.github\.(io|com)$/;

function parseRepo(repo) {
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "index",
"scripts": {
"eslint": "eslint .",
"jscs": "jscs .",
"test": "mocha test/index.js",
"test-cov": "istanbul cover --print both _mocha -- test/index.js"
},
Expand All @@ -27,12 +26,10 @@
"license": "MIT",
"devDependencies": {
"chai": "^3.5.0",
"eslint": "^2.12.0",
"eslint-config-hexo": "^1.0.3",
"eslint": "^5.6.1",
"eslint-config-hexo": "^3.0.0",
"istanbul": "^0.4.3",
"jscs": "^3.0.4",
"jscs-preset-hexo": "^1.0.1",
"mocha": "^2.5.3"
"mocha": "^5.2.0"
},
"dependencies": {
"babel-eslint": "^7.2.1",
Expand Down
178 changes: 89 additions & 89 deletions test/deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ describe('deployer', function() {
var extendDirName = pathFn.basename(extendDir);

return fs.writeFile(pathFn.join(extendDir, 'ext.txt'), 'ext')
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
silent: true
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
silent: true
});
}).then(function() {
return validate();
}).then(function() {
var extTxtFile = pathFn.join(validateDir, extendDirName, 'ext.txt');

return fs.readFile(extTxtFile);
}).then(function(content) {
content.should.eql('ext');
});
}).then(function() {
return validate();
}).then(function() {
var extTxtFile = pathFn.join(validateDir, extendDirName, 'ext.txt');

return fs.readFile(extTxtFile);
}).then(function(content) {
content.should.eql('ext');
});
});

it('multi deployment', function() {
Expand All @@ -136,41 +136,41 @@ describe('deployer', function() {

it('hidden file', function() {
return fs.writeFile(pathFn.join(publicDir, '.hid'), 'hidden')
.then(function() {
return deployer({
repo: fakeRemote,
ignore_hidden: false,
silent: true
.then(function() {
return deployer({
repo: fakeRemote,
ignore_hidden: false,
silent: true
});
}).then(function() {
return validate();
}).then(function() {
return fs.readFile(pathFn.join(validateDir, '.hid'));
}).then(function(content) {
content.should.eql('hidden');
});
}).then(function() {
return validate();
}).then(function() {
return fs.readFile(pathFn.join(validateDir, '.hid'));
}).then(function(content) {
content.should.eql('hidden');
});
});

it('hidden extdir', function() {
var extendDirName = pathFn.basename(extendDir);

return fs.writeFile(pathFn.join(extendDir, '.hid'), 'hidden')
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_hidden: {public: true, extend: false},
silent: true
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_hidden: {public: true, extend: false},
silent: true
});
}).then(function() {
return validate();
}).then(function() {
var extHidFile = pathFn.join(validateDir, extendDirName, '.hid');

return fs.readFile(extHidFile);
}).then(function(content) {
content.should.eql('hidden');
});
}).then(function() {
return validate();
}).then(function() {
var extHidFile = pathFn.join(validateDir, extendDirName, '.hid');

return fs.readFile(extHidFile);
}).then(function(content) {
content.should.eql('hidden');
});
});

it('hidden files', function() {
Expand All @@ -182,36 +182,36 @@ describe('deployer', function() {
var extFileShow = fs.writeFile(pathFn.join(extendDir, 'show'), 'show');

return Promise.all([pubFileHid, extFileHid, extFileShow])
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_pattern: 'hid',
silent: true
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_pattern: 'hid',
silent: true
});
}).then(function() {
return validate();
}).then(function() {
var isPubFileHidExisits = fs.exists(pathFn.join(validateDir, 'hid'));
var isExtFileHidExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'hid'));
var isExtFileShowExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'show'));

return Promise.all([isPubFileHidExisits, isExtFileHidExisits, isExtFileShowExisits]);
}).then(function(statusLists) {
var pubFileHidStatus = statusLists[0];
var extFileHidStatus = statusLists[1];
var extFileShowStatus = statusLists[2];

pubFileHidStatus.should.eql(false);
extFileHidStatus.should.eql(false);
extFileShowStatus.should.eql(true);
}).then(function() {
var extShowFile = pathFn.join(validateDir, extendDirName, 'show');

return fs.readFile(extShowFile);
}).then(function(content) {
content.should.eql('show');
});
}).then(function() {
return validate();
}).then(function() {
var isPubFileHidExisits = fs.exists(pathFn.join(validateDir, 'hid'));
var isExtFileHidExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'hid'));
var isExtFileShowExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'show'));

return Promise.all([isPubFileHidExisits, isExtFileHidExisits, isExtFileShowExisits]);
}).then(function(statusLists) {
var pubFileHidStatus = statusLists[0];
var extFileHidStatus = statusLists[1];
var extFileShowStatus = statusLists[2];

pubFileHidStatus.should.eql(false);
extFileHidStatus.should.eql(false);
extFileShowStatus.should.eql(true);
}).then(function() {
var extShowFile = pathFn.join(validateDir, extendDirName, 'show');

return fs.readFile(extShowFile);
}).then(function(content) {
content.should.eql('show');
});
});

it('hidden extFiles', function() {
Expand All @@ -223,25 +223,25 @@ describe('deployer', function() {
var pubFileHid = fs.writeFile(pathFn.join(publicDir, 'hid'), 'hidden');

return Promise.all([extFileHid, extFile2Hid, pubFileHid])
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_pattern: {public: 'hid', extend: '.'},
silent: true
.then(function() {
return deployer({
repo: fakeRemote,
extend_dirs: extendDirName,
ignore_pattern: {public: 'hid', extend: '.'},
silent: true
});
}).then(function() {
return validate();
}).then(function() {
var isExtHidFileExists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid'));
var isExtHidFile2Exists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid2'));
var isPubHidFileExists = fs.exists(pathFn.join(validateDir, 'hid'));

return Promise.all([isExtHidFileExists, isExtHidFile2Exists, isPubHidFileExists]);
}).then(function(statusLists) {
statusLists.forEach(function(statusItem) {
statusItem.should.eql(false);
});
});
}).then(function() {
return validate();
}).then(function() {
var isExtHidFileExists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid'));
var isExtHidFile2Exists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid2'));
var isPubHidFileExists = fs.exists(pathFn.join(validateDir, 'hid'));

return Promise.all([isExtHidFileExists, isExtHidFile2Exists, isPubHidFileExists]);
}).then(function(statusLists) {
statusLists.forEach(function(statusItem) {
statusItem.should.eql(false);
});
});
});
});

0 comments on commit e6414bb

Please sign in to comment.