Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commitlint/travis-cli

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/travis-cli - npm Package Compare versions

Comparing version 5.2.2 to 5.2.3

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

<a name="5.2.3"></a>
## [5.2.3](https://github.com/marionebl/commitlint/compare/v5.2.2...v5.2.3) (2017-12-05)
**Note:** Version bump only for package @commitlint/travis-cli
<a name="5.2.2"></a>

@@ -8,0 +16,0 @@ ## [5.2.2](https://github.com/marionebl/commitlint/compare/v5.2.1...v5.2.2) (2017-11-30)

307

lib/cli.test.js
'use strict';
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var os = require('os');
var _require = require('@commitlint/test'),
git = _require.git;
// Disable ftb
// const os = require('os');
// const {git} = require('@commitlint/test');
var test = require('ava');
var execa = require('execa');
var which = require('which');
// Disable ftb
// const which = require('which');
var NODE_BIN = which.sync('node');
// Disable ftb
// const NODE_BIN = which.sync('node');
var BIN = require.resolve('../lib/cli.js');
var TRAVIS_COMMITLINT_BIN = require.resolve('../fixtures/commitlint');
var TRAVIS_COMMITLINT_GIT_BIN = require.resolve('../fixtures/git');
var TRAVIS_BRANCH = 'TRAVIS_BRANCH';
var TRAVIS_COMMIT = 'TRAVIS_COMMIT';
// Disable ftb
// const TRAVIS_COMMITLINT_BIN = require.resolve('../fixtures/commitlint');
// const TRAVIS_COMMITLINT_GIT_BIN = require.resolve('../fixtures/git');
// const TRAVIS_BRANCH = 'TRAVIS_BRANCH';
// const TRAVIS_COMMIT = 'TRAVIS_COMMIT';

@@ -70,7 +65,6 @@ var bin = function bin() {

test.failing('should throw when on travis ci, but env vars are missing', function (t) {
return new Promise(function ($return, $error) {
var env;
env = {
/* Test.failing(
'should throw when on travis ci, but env vars are missing',
async t => {
const env = {
TRAVIS: true,

@@ -80,11 +74,5 @@ CI: true

return Promise.resolve(t.throws(bin({ env }), /TRAVIS_COMMIT, TRAVIS_BRANCH/)).then(function ($await_4) {
try {
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this));
});
await t.throws(bin({env}), /TRAVIS_COMMIT, TRAVIS_BRANCH/);
}
); */

@@ -100,3 +88,3 @@ test('should throw when on travis ci, but TRAVIS_COMMIT is missing', function (t) {

return Promise.resolve(t.throws(bin({ env }), /TRAVIS_COMMIT/)).then(function ($await_5) {
return Promise.resolve(t.throws(bin({ env }), /TRAVIS_COMMIT/)).then(function ($await_4) {
try {

@@ -111,7 +99,6 @@ return $return();

test.failing('should throw when on travis ci, but TRAVIS_BRANCH is missing', function (t) {
return new Promise(function ($return, $error) {
var env;
env = {
/* Test.failing(
'should throw when on travis ci, but TRAVIS_BRANCH is missing',
async t => {
const env = {
TRAVIS: true,

@@ -121,137 +108,153 @@ CI: true

return Promise.resolve(t.throws(bin({ env }), /TRAVIS_BRANCH/)).then(function ($await_6) {
try {
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this));
});
await t.throws(bin({env}), /TRAVIS_BRANCH/);
}
);
test.failing('should call git with expected args on shallow repo', function (t) {
return new Promise(function ($return, $error) {
var cwd, env, result, invocations, _invocations, stash, branches, unshallow, checkout, back, pop, commilint;
test.failing('should call git with expected args on shallow repo', async t => {
if (os.platform() === 'win32') {
t.pass();
return;
}
if (os.platform() === 'win32') {
t.pass();
return $return();
}
const cwd = await git.clone('https://github.com/marionebl/commitlint.git', [
'--depth=10'
]);
return Promise.resolve(git.clone('https://github.com/marionebl/commitlint.git', ['--depth=10'])).then(function ($await_7) {
try {
cwd = $await_7;
const env = {
TRAVIS: true,
CI: true,
TRAVIS_BRANCH,
TRAVIS_COMMIT,
TRAVIS_COMMITLINT_BIN,
TRAVIS_COMMITLINT_GIT_BIN
};
env = {
TRAVIS: true,
CI: true,
TRAVIS_BRANCH,
TRAVIS_COMMIT,
TRAVIS_COMMITLINT_BIN,
TRAVIS_COMMITLINT_GIT_BIN
};
const result = await bin({cwd, env});
const invocations = await getInvocations(result.stdout);
t.is(invocations.length, 7);
return Promise.resolve(bin({ cwd, env })).then(function ($await_8) {
try {
result = $await_8;
return Promise.resolve(getInvocations(result.stdout)).then(function ($await_9) {
try {
invocations = $await_9;
t.is(invocations.length, 7);
const [
stash,
branches,
unshallow,
checkout,
back,
pop,
commilint
] = invocations;
_invocations = (0, _slicedToArray3.default)(invocations, 7), stash = _invocations[0], branches = _invocations[1], unshallow = _invocations[2], checkout = _invocations[3], back = _invocations[4], pop = _invocations[5], commilint = _invocations[6];
t.deepEqual(stash, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash']);
t.deepEqual(branches, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'remote', 'set-branches', 'origin', TRAVIS_BRANCH]);
t.deepEqual(unshallow, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'fetch', '--unshallow', '--quiet']);
t.deepEqual(checkout, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'checkout', TRAVIS_BRANCH, '--quiet']);
t.deepEqual(back, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'checkout', '-', '--quiet']);
t.deepEqual(pop, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash', 'pop']);
t.deepEqual(commilint, [NODE_BIN, TRAVIS_COMMITLINT_BIN, '--from', TRAVIS_BRANCH, '--to', TRAVIS_COMMIT]);
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this));
t.deepEqual(stash, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash']);
t.deepEqual(branches, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'remote',
'set-branches',
'origin',
TRAVIS_BRANCH
]);
t.deepEqual(unshallow, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'fetch',
'--unshallow',
'--quiet'
]);
t.deepEqual(checkout, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'checkout',
TRAVIS_BRANCH,
'--quiet'
]);
t.deepEqual(back, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'checkout',
'-',
'--quiet'
]);
t.deepEqual(pop, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash', 'pop']);
t.deepEqual(commilint, [
NODE_BIN,
TRAVIS_COMMITLINT_BIN,
'--from',
TRAVIS_BRANCH,
'--to',
TRAVIS_COMMIT
]);
});
test.failing('should call git with expected args on unshallow repo', function (t) {
return new Promise(function ($return, $error) {
var cwd, env, result, invocations, _invocations2, stash, branches, checkout, back, pop, commilint;
test.failing(
'should call git with expected args on unshallow repo',
async t => {
if (os.platform() === 'win32') {
t.pass();
return $return();
return;
}
return Promise.resolve(git.clone('https://github.com/marionebl/commitlint.git')).then(function ($await_10) {
try {
cwd = $await_10;
const cwd = await git.clone('https://github.com/marionebl/commitlint.git');
env = {
TRAVIS: true,
CI: true,
TRAVIS_BRANCH,
TRAVIS_COMMIT,
TRAVIS_COMMITLINT_BIN,
TRAVIS_COMMITLINT_GIT_BIN
};
const env = {
TRAVIS: true,
CI: true,
TRAVIS_BRANCH,
TRAVIS_COMMIT,
TRAVIS_COMMITLINT_BIN,
TRAVIS_COMMITLINT_GIT_BIN
};
return Promise.resolve(bin({ cwd, env })).then(function ($await_11) {
try {
result = $await_11;
return Promise.resolve(getInvocations(result.stdout)).then(function ($await_12) {
try {
invocations = $await_12;
t.is(invocations.length, 6);
const result = await bin({cwd, env});
const invocations = await getInvocations(result.stdout);
t.is(invocations.length, 6);
_invocations2 = (0, _slicedToArray3.default)(invocations, 6), stash = _invocations2[0], branches = _invocations2[1], checkout = _invocations2[2], back = _invocations2[3], pop = _invocations2[4], commilint = _invocations2[5];
const [stash, branches, checkout, back, pop, commilint] = invocations;
t.deepEqual(stash, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash']);
t.deepEqual(branches, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'remote',
'set-branches',
'origin',
TRAVIS_BRANCH
]);
t.deepEqual(checkout, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'checkout',
TRAVIS_BRANCH,
'--quiet'
]);
t.deepEqual(back, [
NODE_BIN,
TRAVIS_COMMITLINT_GIT_BIN,
'checkout',
'-',
'--quiet'
]);
t.deepEqual(pop, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash', 'pop']);
t.deepEqual(commilint, [
NODE_BIN,
TRAVIS_COMMITLINT_BIN,
'--from',
TRAVIS_BRANCH,
'--to',
TRAVIS_COMMIT
]);
}
);
t.deepEqual(stash, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash']);
t.deepEqual(branches, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'remote', 'set-branches', 'origin', TRAVIS_BRANCH]);
t.deepEqual(checkout, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'checkout', TRAVIS_BRANCH, '--quiet']);
t.deepEqual(back, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'checkout', '-', '--quiet']);
t.deepEqual(pop, [NODE_BIN, TRAVIS_COMMITLINT_GIT_BIN, 'stash', 'pop']);
t.deepEqual(commilint, [NODE_BIN, TRAVIS_COMMITLINT_BIN, '--from', TRAVIS_BRANCH, '--to', TRAVIS_COMMIT]);
return $return();
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}.bind(this));
});
function getInvocations(stdout) {
var matches = stdout.match(/[^[\]]+/g);
var raw = Array.isArray(matches) ? matches : [];
const matches = stdout.match(/[^[\]]+/g);
const raw = Array.isArray(matches) ? matches : [];
return raw.filter(function (invocation) {
return invocation !== '\n';
}).map(function (invocation) {
return invocation.split(',').map(function (fragment) {
return fragment.trim();
}).map(function (fragment) {
return fragment.substring(1, fragment.length - 1);
}).filter(Boolean);
});
return raw.filter(invocation => invocation !== '\n').map(invocation =>
invocation
.split(',')
.map(fragment => fragment.trim())
.map(fragment => fragment.substring(1, fragment.length - 1))
.filter(Boolean)
);
}
*/
//# sourceMappingURL=cli.test.js.map
{
"name": "@commitlint/travis-cli",
"version": "5.2.2",
"version": "5.2.3",
"description": "Lint all relevant commits for a change or PR on Travis CI",

@@ -67,3 +67,3 @@ "bin": {

"dependencies": {
"@commitlint/cli": "^5.2.0",
"@commitlint/cli": "^5.2.3",
"babel-runtime": "^6.26.0",

@@ -70,0 +70,0 @@ "execa": "^0.8.0"

@@ -1,14 +0,18 @@

const os = require('os');
const {git} = require('@commitlint/test');
// Disable ftb
// const os = require('os');
// const {git} = require('@commitlint/test');
const test = require('ava');
const execa = require('execa');
const which = require('which');
// Disable ftb
// const which = require('which');
const NODE_BIN = which.sync('node');
// Disable ftb
// const NODE_BIN = which.sync('node');
const BIN = require.resolve('../lib/cli.js');
const TRAVIS_COMMITLINT_BIN = require.resolve('../fixtures/commitlint');
const TRAVIS_COMMITLINT_GIT_BIN = require.resolve('../fixtures/git');
const TRAVIS_BRANCH = 'TRAVIS_BRANCH';
const TRAVIS_COMMIT = 'TRAVIS_COMMIT';
// Disable ftb
// const TRAVIS_COMMITLINT_BIN = require.resolve('../fixtures/commitlint');
// const TRAVIS_COMMITLINT_GIT_BIN = require.resolve('../fixtures/git');
// const TRAVIS_BRANCH = 'TRAVIS_BRANCH';
// const TRAVIS_COMMIT = 'TRAVIS_COMMIT';

@@ -35,3 +39,3 @@ const bin = async (config = {}) => {

test.failing(
/* Test.failing(
'should throw when on travis ci, but env vars are missing',

@@ -46,3 +50,3 @@ async t => {

}
);
); */

@@ -58,3 +62,3 @@ test('should throw when on travis ci, but TRAVIS_COMMIT is missing', async t => {

test.failing(
/* Test.failing(
'should throw when on travis ci, but TRAVIS_BRANCH is missing',

@@ -217,1 +221,2 @@ async t => {

}
*/

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc