@zohodesk/testinglibrary 0.1.8-eslint-18 → 0.1.8-eslint-19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {}
@@ -35,26 +35,27 @@ async function runEslintForDiff(cliParams, options = {}) {
35
35
  return await new Promise(resolve => {
36
36
  const command = ['eslint', lintFiles.join(' '), `--format=${format}`, '-o', `${reportPath}`];
37
37
  try {
38
- const lint_process = (0, _child_process.spawnSync)('npx', command, {
38
+ const lint_process = (0, _child_process.spawn)('npx', command, {
39
39
  shell: true,
40
40
  cwd: process.cwd()
41
41
  });
42
- if (lint_process.stderr) {
43
- _logger.Logger.log(_logger.Logger.FAILURE_TYPE, lint_process.stderr.toString());
44
- }
45
- if (lint_process.error) {
46
- throw lintFiles.error;
47
- }
42
+ lint_process.stdout.on('data', data => {
43
+ _logger.Logger.log(_logger.Logger.INFO_TYPE, data);
44
+ });
45
+ lint_process.stderr.on('error', err => {
46
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, err);
47
+ });
48
+ lint_process.on('close', onclose => {
49
+ if (diffPath && !(filteredDiffFiles.length === 0)) {
50
+ (0, _fileUtils.writeFileContents)(reportPath, filterReport_JSON(require(reportPath), diffJSON));
51
+ }
52
+ resolve({
53
+ status: 'success'
54
+ });
55
+ });
48
56
  } catch (error) {
49
57
  _logger.Logger.log(_logger.Logger.INFO_TYPE, error);
50
58
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Execution Failed');
51
- } finally {
52
- if (diffPath && !(filteredDiffFiles.length === 0)) {
53
- (0, _fileUtils.writeFileContents)(reportPath, filterReport_JSON(require(reportPath), diffJSON));
54
- }
55
- resolve({
56
- status: 'success'
57
- });
58
59
  }
59
60
  });
60
61
  }
@@ -142,7 +143,7 @@ function getDiffJsonPath(diffJsonPath) {
142
143
  return _path.default.resolve(diffJsonPath);
143
144
  }
144
145
  function gitDiffFiles() {
145
- const command = 'git diff --cached -U0 HEAD';
146
+ const command = 'git diff --cached -U0 HEAD --name-only';
146
147
  const child = (0, _child_process.spawnSync)(command, {
147
148
  shell: true
148
149
  });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ const {
4
+ spawn
5
+ } = require('child_process');
@@ -18,8 +18,8 @@ function getSummaryOfLint(cliParams) {
18
18
  lintEnv
19
19
  } = (0, _cliArgsToObject.cliArgsToObject)(cliParams);
20
20
  return {
21
- projectNameL: lintEnv === 'pre-commit' ? (0, _startSeverSonarQube.getProjectNameFrmGit)() : `${repo}_${branch},${username}`,
22
- reportUrl: `https://serverlinter.zohodesk.csez.zohocorpin.com/project/issues?id=${repo}_${branch}_${username}&resolve=false`,
21
+ projectName: lintEnv === 'pre-commit' ? (0, _startSeverSonarQube.getProjectNameFrmGit)() : `${repo}_${branch},${username}`,
22
+ reportUrl: `https://serverlinter-np.zohodesk.csez.zohocorpin.com/project/issues?id=${repo}_${branch}_${username}&resolve=false`,
23
23
  jsonReportPath: (0, _eslintLintStage.getReportPath)().toString()
24
24
  };
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.8-eslint-18",
3
+ "version": "0.1.8-eslint-19",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {