Socket
Socket
Sign inDemoInstall

jest-changed-files

Package Overview
Dependencies
0
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 12.0.2 to 12.1.0

2

package.json
{
"name": "jest-changed-files",
"version": "12.0.2",
"version": "12.1.0",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -35,9 +35,9 @@ /**

pit('returns null for non hg repo folder', () => {
return hg.isHGRepository(tmpdir).then(res => {
it('returns null for non hg repo folder', () =>
hg.isHGRepository(tmpdir).then(res => {
expect(res).toBeNull();
});
});
})
);
pit('returns dirname for hg repo folder', () => {
it('returns dirname for hg repo folder', () => {
childProcess.spawnSync('hg', ['init', tmpdir]);

@@ -57,9 +57,9 @@

pit('returns an empty array for hg repo folder without modified files', () => {
return hg.findChangedFiles(tmpdir).then(res => {
it('returns an empty array for hg repo folder without modified files', () =>
hg.findChangedFiles(tmpdir).then(res => {
expect(res).toEqual([]);
});
});
})
);
pit('returns an array of modified files for hg repo folder', () => {
it('returns an array of modified files for hg repo folder', () => {
fs.writeFileSync(tmpfile);

@@ -66,0 +66,0 @@ fs.writeFileSync(tmpfileNested);

@@ -23,2 +23,3 @@ /**

child.stderr.on('data', data => stderr += data);
child.on('error', e => reject(e));
child.on('close', code => {

@@ -25,0 +26,0 @@ if (code === 0) {

@@ -14,10 +14,13 @@ /**

const env = Object.assign({}, process.env, {
HGPLAIN: 1,
});
function findChangedFiles(cwd, options) {
return new Promise((resolve, reject) => {
const args = ['status', '--root-relative', '-amn'];
const args = ['status', '-amn'];
if (options && options.withAncestor) {
args.push('--rev', 'ancestor(.^)');
}
const child = childProcess.spawn('hg', args, {cwd});
const child = childProcess.spawn('hg', args, {cwd, env});
let stdout = '';

@@ -27,2 +30,3 @@ let stderr = '';

child.stderr.on('data', data => stderr += data);
child.on('error', e => reject(e));
child.on('close', code => {

@@ -49,3 +53,3 @@ if (code === 0) {

let stdout = '';
const child = childProcess.spawn('hg', ['root'], {cwd});
const child = childProcess.spawn('hg', ['root'], {cwd, env});
child.stdout.on('data', data => stdout += data);

@@ -52,0 +56,0 @@ child.on('error', () => resolve(null));

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc