@zohodesk/testinglibrary 0.1.8-eslint-7 → 0.1.8-eslint-9

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.
Files changed (93) hide show
  1. package/build/bdd-framework/cli/commands/env.js +42 -0
  2. package/build/bdd-framework/cli/commands/export.js +47 -0
  3. package/build/bdd-framework/cli/commands/test.js +64 -0
  4. package/build/bdd-framework/cli/index.js +11 -0
  5. package/build/bdd-framework/cli/options.js +19 -0
  6. package/build/bdd-framework/cli/worker.js +13 -0
  7. package/build/bdd-framework/config/dir.js +27 -0
  8. package/build/bdd-framework/config/env.js +50 -0
  9. package/build/bdd-framework/config/index.js +90 -0
  10. package/build/bdd-framework/config/lang.js +14 -0
  11. package/build/bdd-framework/cucumber/buildStepDefinition.js +43 -0
  12. package/build/bdd-framework/cucumber/gherkin.d.js +5 -0
  13. package/build/bdd-framework/cucumber/loadConfig.js +17 -0
  14. package/build/bdd-framework/cucumber/loadFeatures.js +39 -0
  15. package/build/bdd-framework/cucumber/loadSnippetBuilder.js +20 -0
  16. package/build/bdd-framework/cucumber/loadSources.js +57 -0
  17. package/build/bdd-framework/cucumber/loadSteps.js +40 -0
  18. package/build/bdd-framework/decorators.js +18 -0
  19. package/build/bdd-framework/gen/fixtures.js +48 -0
  20. package/build/bdd-framework/gen/formatter.js +135 -0
  21. package/build/bdd-framework/gen/i18n.js +39 -0
  22. package/build/bdd-framework/gen/index.js +164 -0
  23. package/build/bdd-framework/gen/testFile.js +422 -0
  24. package/build/bdd-framework/gen/testNode.js +61 -0
  25. package/build/bdd-framework/gen/testPoms.js +133 -0
  26. package/build/bdd-framework/hooks/scenario.js +107 -0
  27. package/build/bdd-framework/hooks/worker.js +83 -0
  28. package/build/bdd-framework/index.js +45 -0
  29. package/build/bdd-framework/playwright/fixtureParameterNames.js +93 -0
  30. package/build/bdd-framework/playwright/getLocationInFile.js +52 -0
  31. package/build/bdd-framework/playwright/loadConfig.js +42 -0
  32. package/build/bdd-framework/playwright/testTypeImpl.js +61 -0
  33. package/build/bdd-framework/playwright/transform.js +84 -0
  34. package/build/bdd-framework/playwright/types.js +5 -0
  35. package/build/bdd-framework/playwright/utils.js +34 -0
  36. package/build/bdd-framework/run/StepInvoker.js +73 -0
  37. package/build/bdd-framework/run/bddFixtures.js +170 -0
  38. package/build/bdd-framework/run/bddWorld.js +76 -0
  39. package/build/bdd-framework/snippets/index.js +136 -0
  40. package/build/bdd-framework/snippets/snippetSyntax.js +43 -0
  41. package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +26 -0
  42. package/build/bdd-framework/snippets/snippetSyntaxTs.js +18 -0
  43. package/build/bdd-framework/stepDefinitions/createBdd.js +66 -0
  44. package/build/bdd-framework/stepDefinitions/decorators/class.js +68 -0
  45. package/build/bdd-framework/stepDefinitions/decorators/steps.js +99 -0
  46. package/build/bdd-framework/stepDefinitions/defineStep.js +62 -0
  47. package/build/bdd-framework/stepDefinitions/stepConfig.js +24 -0
  48. package/build/bdd-framework/utils/exit.js +62 -0
  49. package/build/bdd-framework/utils/index.js +70 -0
  50. package/build/bdd-framework/utils/jsStringWrap.js +44 -0
  51. package/build/bdd-framework/utils/logger.js +30 -0
  52. package/build/core/playwright/builtInFixtures/addTags.js +1 -1
  53. package/build/core/playwright/builtInFixtures/index.js +2 -6
  54. package/build/core/playwright/index.js +18 -14
  55. package/build/core/playwright/setup/config-creator.js +8 -19
  56. package/build/core/playwright/setup/config-utils.js +13 -15
  57. package/build/core/playwright/tag-processor.js +12 -23
  58. package/build/core/playwright/test-runner.js +31 -58
  59. package/build/decorators.d.ts +1 -1
  60. package/build/decorators.js +16 -2
  61. package/build/eslint-ci/eslintLintStage.js +19 -9
  62. package/build/eslint-ci/reportServerConfig.js +8 -1
  63. package/build/eslint-ci/startSever-sonarQube.js +2 -2
  64. package/build/index.d.ts +48 -1
  65. package/build/index.js +18 -15
  66. package/build/lib/cli.js +1 -1
  67. package/build/setup-folder-structure/samples/git-ignore.sample.js +1 -4
  68. package/build/utils/fileUtils.js +1 -19
  69. package/build/utils/getFilePath.js +1 -2
  70. package/npm-shrinkwrap.json +506 -122
  71. package/package.json +7 -8
  72. package/playwright.config.js +1 -1
  73. package/build/bdd-poc/config/pathConfig.js +0 -26
  74. package/build/bdd-poc/core-runner/createCallbacksMap.js +0 -26
  75. package/build/bdd-poc/core-runner/exportMethods.js +0 -24
  76. package/build/bdd-poc/core-runner/intialize.js +0 -15
  77. package/build/bdd-poc/core-runner/main.js +0 -21
  78. package/build/bdd-poc/core-runner/stepRunner.js +0 -98
  79. package/build/bdd-poc/errors/throwError.js +0 -26
  80. package/build/bdd-poc/gherkin-parser/createTestTemplate.js +0 -40
  81. package/build/bdd-poc/gherkin-parser/cucumber/cucumber.js +0 -15
  82. package/build/bdd-poc/gherkin-parser/cucumber/cucumberSynatxParser.js +0 -85
  83. package/build/bdd-poc/gherkin-parser/cucumber/data-driven/dataSourceMap.js +0 -111
  84. package/build/bdd-poc/gherkin-parser/stepsDefinition/extractTestInputs.js +0 -68
  85. package/build/bdd-poc/gherkin-parser/stepsDefinition/generateStep.js +0 -92
  86. package/build/bdd-poc/gherkin-parser/stepsDefinition/parserStepsArguments.js +0 -79
  87. package/build/bdd-poc/gherkin-parser/tagsHandle.js +0 -70
  88. package/build/bdd-poc/index.js +0 -26
  89. package/build/bdd-poc/snippets/stepsnippets.js +0 -64
  90. package/build/bdd-poc/utils/stringManipulation.js +0 -26
  91. package/build/eslint-ci/java-jar/sonar-scanner-cli-4.8.0.2856.jar +0 -0
  92. package/lintjson.json +0 -105
  93. package/main.js +0 -61
@@ -14,10 +14,6 @@ var _logger = require("../../utils/logger");
14
14
  var _readConfigFile = require("./readConfigFile");
15
15
  var _rootPath = require("../../utils/rootPath");
16
16
  var _tagProcessor = require("./tag-processor");
17
- var _bddPoc = require("../../bdd-poc");
18
- // import { createGlobalMaps } from '../../bdd-poc/core-runner/intialize';
19
- // import { allowedTags } from '../../bdd-poc/test/tagsHandle';
20
-
21
17
  function parseUserArgs() {
22
18
  return (0, _cliArgsToObject.cliArgsToObject)(process.argv.slice(2));
23
19
  }
@@ -26,61 +22,41 @@ function getPlaywrightArgs(userArgsObject, debug, bddMode, tagArgs, headless) {
26
22
  if (debug) {
27
23
  playwrightArgs.push('--debug');
28
24
  }
29
-
30
- // if (!bddMode && tagArgs) {
31
- // playwrightArgs.push('--grep');
32
- // playwrightArgs.push(tagArgs);
33
- // }
34
-
35
- if (tagArgs && userArgsObject !== null && userArgsObject !== void 0 && userArgsObject.edition || userArgsObject !== null && userArgsObject !== void 0 && userArgsObject.tags) {
36
- const {
37
- tags,
38
- editionTags
39
- } = tagArgs;
40
- if (tags) {
41
- playwrightArgs.push('--grep');
42
- playwrightArgs.push(tags);
43
- }
44
- if (editionTags) {
45
- playwrightArgs.push('--grep-invert');
46
- playwrightArgs.push(editionTags);
47
- }
25
+ if (!bddMode && tagArgs) {
26
+ playwrightArgs.push('--grep');
27
+ playwrightArgs.push(tagArgs);
48
28
  }
49
29
  if (!headless && !userArgsObject.headed) {
50
30
  playwrightArgs.push('--headed');
51
31
  }
52
32
  return playwrightArgs;
53
33
  }
54
-
55
- // function runPreprocessing(tagArgs, configPath) {
56
- // const beforeCommand = 'node';
57
- // const bddGenPath = path.resolve(__dirname, '../', '../', 'bdd-framework', 'cli', 'index.js');
58
- // const beforeArgs = [bddGenPath, '-c', configPath];
59
-
60
- // if (tagArgs) {
61
- // beforeArgs.push('--tags');
62
- // beforeArgs.push(tagArgs);
63
- // }
64
-
65
- // return new Promise((resolve, reject) => {
66
- // const childProcessForPreprocessing = spawn(beforeCommand, beforeArgs, { stdio: 'inherit' });
67
-
68
- // childProcessForPreprocessing.on('error', (data) => {
69
- // Logger.log(Logger.FAILURE_TYPE, data);
70
- // reject();
71
- // });
72
-
73
- // childProcessForPreprocessing.on('exit', (code) => {
74
- // if (code === 0) {
75
- // Logger.log(Logger.SUCCESS_TYPE, 'Feature Files Processed Successfully');
76
- // resolve();
77
- // } else {
78
- // reject(`BddGen exited with code ${code}`);
79
- // }
80
- // });
81
- // });
82
- // }
83
-
34
+ function runPreprocessing(tagArgs, configPath) {
35
+ const beforeCommand = 'node';
36
+ const bddGenPath = _path.default.resolve(__dirname, '../', '../', 'bdd-framework', 'cli', 'index.js');
37
+ const beforeArgs = [bddGenPath, '-c', configPath];
38
+ if (tagArgs) {
39
+ beforeArgs.push('--tags');
40
+ beforeArgs.push(tagArgs);
41
+ }
42
+ return new Promise((resolve, reject) => {
43
+ const childProcessForPreprocessing = (0, _child_process.spawn)(beforeCommand, beforeArgs, {
44
+ stdio: 'inherit'
45
+ });
46
+ childProcessForPreprocessing.on('error', data => {
47
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, data);
48
+ reject();
49
+ });
50
+ childProcessForPreprocessing.on('exit', code => {
51
+ if (code === 0) {
52
+ _logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Feature Files Processed Successfully');
53
+ resolve();
54
+ } else {
55
+ reject(`BddGen exited with code ${code}`);
56
+ }
57
+ });
58
+ });
59
+ }
84
60
  function runPlaywright(command, args) {
85
61
  return new Promise((resolve, reject) => {
86
62
  const childProcessForRunningPlaywright = (0, _child_process.spawn)(command, args, {
@@ -119,19 +95,16 @@ function main() {
119
95
  editionOrder
120
96
  } = (0, _readConfigFile.generateConfigFromFile)();
121
97
  const tagArgs = (0, _tagProcessor.tagProcessor)(userArgsObject, editionOrder);
122
- // const tagArgs = allowedTags(userArgsObject)
123
-
124
98
  const playwrightArgs = getPlaywrightArgs(userArgsObject, debug, bddMode, tagArgs, headless);
125
99
  (0, _envInitializer.initializeEnvConfig)(userArgsObject.mode ? userArgsObject.mode : mode);
126
100
  const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
127
101
  const command = playwrightPath;
128
102
  const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? require.resolve('./setup/config-creator.js') : require.resolve('../../../playwright.config.js');
103
+ const args = ['test', '--config', configPath].concat(playwrightArgs);
129
104
  let promises = [];
130
105
  if (bddMode) {
131
- promises.push((0, _bddPoc.preProcessGherkin)());
132
- // promises.push(createGlobalMaps());
106
+ promises.push(runPreprocessing(tagArgs, configPath));
133
107
  }
134
- const args = ['test', '--config', configPath].concat(playwrightArgs);
135
108
  Promise.all(promises).then(() => runPlaywright(command, args)).catch(err => {
136
109
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, err);
137
110
  process.exit();
@@ -1 +1 @@
1
- // export * from './bdd-framework/decorators';
1
+ export * from './bdd-framework/decorators';
@@ -1,2 +1,16 @@
1
- // export * from './bdd-framework/decorators';
2
- "use strict";
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _decorators = require("./bdd-framework/decorators");
7
+ Object.keys(_decorators).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _decorators[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _decorators[key];
14
+ }
15
+ });
16
+ });
@@ -36,7 +36,7 @@ var _fs = require("fs");
36
36
  // return actualDiff_Files;
37
37
  // }
38
38
 
39
- function runEslintForDiff(cliParams, options = {}) {
39
+ async function runEslintForDiff(cliParams, options = {}) {
40
40
  // $(git diff --name-only HEAD HEAD~1 | grep -E '\.(js|jsx)$' | xargs)
41
41
  const {
42
42
  diffPath
@@ -46,22 +46,29 @@ function runEslintForDiff(cliParams, options = {}) {
46
46
  const diffJSON = require(_path.default.resolve(diffPath));
47
47
  const filteredDiffFiles = getDiffFiles(diffJSON);
48
48
  const lintFiles = filteredDiffFiles.length === 0 ? [_path.default.resolve(process.cwd(), 'uat', 'modules')] : filteredDiffFiles;
49
- return new Promise(resolve => {
49
+ await new Promise(resolve => {
50
50
  (0, _child_process.exec)(`npx eslint ${lintFiles.join(' ')} --format=${format} -o ${reportPath}`, (stdout, stderr) => {
51
51
  _logger.Logger.log(_logger.Logger.FAILURE_TYPE, stderr);
52
- resolve(stdout);
53
52
  });
54
- }).then(response => {
55
- (0, _fs.writeFileSync)(reportPath, filterReport_JSON(require(reportPath), diffJSON));
53
+ resolve(require(reportPath));
54
+ }).finally(() => {
55
+ if (!(filteredDiffFiles.length === 0)) {
56
+ (0, _fs.writeFileSync)(reportPath, filterReport_JSON(require(reportPath), diffJSON));
57
+ }
56
58
  });
57
59
  }
58
60
  function filterReport_JSON(resultJson, diffJson) {
59
61
  const impactLineArray = filterDiffJson(diffJson);
60
62
  resultJson = resultJson.filter(result => {
61
63
  var _impactLineArray$get;
62
- if (((_impactLineArray$get = impactLineArray.get(getPathFromTestDir(result.filePath))) === null || _impactLineArray$get === void 0 ? void 0 : _impactLineArray$get.length) !== 0) {
64
+ const isImpactFile = getPathFromTestDir(result.filePath);
65
+ console.log(isImpactFile);
66
+ if (!isImpactFile) {
67
+ return false;
68
+ }
69
+ if (((_impactLineArray$get = impactLineArray.get(isImpactFile)) === null || _impactLineArray$get === void 0 ? void 0 : _impactLineArray$get.length) !== 0) {
63
70
  result.messages = result.messages.filter(errorMsg => {
64
- if (impactLineArray.get(getPathFromTestDir(result.filePath)).includes(errorMsg.line)) {
71
+ if (impactLineArray.get(isImpactFile).includes(errorMsg.line)) {
65
72
  return true;
66
73
  }
67
74
  return false;
@@ -87,6 +94,9 @@ function filterDiffJson(diffJson) {
87
94
  diffMatch.push(...splitFilterNumber(match[1]));
88
95
  }
89
96
  const diffPathKey = getPathFromTestDir(diff.new_path);
97
+ if (diffPathKey === undefined) {
98
+ return;
99
+ }
90
100
  if (diffPathKey) {
91
101
  diffFilesMap.set(diffPathKey, diffMatch);
92
102
  }
@@ -94,11 +104,11 @@ function filterDiffJson(diffJson) {
94
104
  return diffFilesMap;
95
105
  }
96
106
  function getPathFromTestDir(diffPath) {
97
- if (!(diffPath !== null && diffPath !== void 0 && diffPath.contains('uat'))) {
107
+ if (!diffPath.includes('uat')) {
98
108
  return undefined;
99
109
  }
100
110
  const indexOfDiff = diffPath.split('/').indexOf('uat');
101
- const diffActualPath = diffPath.slice(indexOfDiff).join('/');
111
+ const diffActualPath = diffPath.split('/').slice(indexOfDiff).join('/');
102
112
  return diffActualPath;
103
113
  }
104
114
  function splitFilterNumber(numberString) {
@@ -8,6 +8,7 @@ exports.getDefaultServerProperties = getDefaultServerProperties;
8
8
  exports.getProperties = getProperties;
9
9
  var _path = _interopRequireDefault(require("path"));
10
10
  var _cliArgsToObject = require("../utils/cliArgsToObject");
11
+ var _logger = require("../utils/logger");
11
12
  function getDefaultServerProperties() {
12
13
  return {
13
14
  'sonar.projectName': 'UAT_Testing',
@@ -26,8 +27,14 @@ function getProperties(cliParams, login, password, sources, testDir, language, e
26
27
  branch,
27
28
  username
28
29
  } = (0, _cliArgsToObject.cliArgsToObject)(cliParams);
30
+ var isProjectNameDefined = false;
31
+ const projectName = repo && branch && username ? `${repo}_${branch}_${username}` : isProjectNameDefined = true;
32
+ if (isProjectNameDefined && login && password && eslintReportPath) {
33
+ _logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Project Properties is Missing');
34
+ process.exit(0);
35
+ }
29
36
  return {
30
- 'sonar.projectName': `${repo}_${branch}_${username}`,
37
+ 'sonar.projectName': projectName,
31
38
  'sonar.login': login,
32
39
  'sonar.password': password,
33
40
  'sonar.sources': sources,
@@ -12,7 +12,7 @@ var _reportServerConfig = require("./reportServerConfig");
12
12
  // Js script to start sonar Server
13
13
 
14
14
  /**
15
- * cli cmd :
15
+ * cli cmd :
16
16
  * npx ZDTestingFramework lint -- --lintEnv=ci --diffPath="" --repo="deskClientApp" --branch="" --username=""
17
17
  */
18
18
 
@@ -22,7 +22,7 @@ function sonarQubeIntegrateAnalysis(cliParams, option) {
22
22
  const testDir = _path.default.resolve(process.cwd(), 'uat', 'modules');
23
23
  const eslintResult = _path.default.resolve(process.cwd(), 'uat', 'eslint-report', 'lintReport.json');
24
24
  const artifactsPath = _path.default.resolve(process.cwd(), 'uat', '.scannerwork');
25
- const options = (0, _reportServerConfig.getProperties)(cliParams, "developer", "developer", "", testDir, 'js', eslintResult, artifactsPath);
25
+ const options = (0, _reportServerConfig.getProperties)(cliParams, 'developer', 'developer', '', testDir, 'js', eslintResult, artifactsPath);
26
26
  (0, _sonarqubeScanner.default)({
27
27
  serverUrl: serverHostUrl,
28
28
  options: options
package/build/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { expect, test } from './core/playwright/index';
2
- // import { fireEvent, render } from '@testing-library/react';
2
+ import { fireEvent, render } from '@testing-library/react';
3
3
  import {
4
4
  PlaywrightTestArgs,
5
5
  PlaywrightTestOptions,
@@ -8,6 +8,53 @@ import {
8
8
  TestType,
9
9
  Page
10
10
  } from '@playwright/test';
11
+ import { DefineStepPattern } from '@cucumber/cucumber/lib/support_code_library_builder/types';
11
12
 
13
+ export type KeyValue = { [key: string]: any };
14
+
15
+ export type BuiltInFixturesWorker = PlaywrightWorkerArgs &
16
+ PlaywrightWorkerOptions;
17
+ export type BuiltInFixtures = PlaywrightTestArgs &
18
+ PlaywrightTestOptions &
19
+ BuiltInFixturesWorker;
20
+
21
+ export type FixturesArg<T extends KeyValue = {}, W extends KeyValue = {}> = T &
22
+ W &
23
+ BuiltInFixtures;
24
+
25
+ export declare let hasCustomTest: boolean;
26
+
27
+ export declare function createBdd<
28
+ T extends KeyValue = BuiltInFixtures,
29
+ W extends KeyValue = BuiltInFixturesWorker,
30
+ World
31
+ >(
32
+ customTest?: TestType<T, W> | null,
33
+ _CustomWorld?: new (...args: any[]) => World
34
+ ): {
35
+ Given: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
36
+ When: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
37
+ Then: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
38
+ And: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
39
+ But: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
40
+ Step: (pattern: DefineStepPattern, fn: StepFunction<T, W>) => void;
41
+ Before: any;
42
+ After: any;
43
+ BeforeAll: any;
44
+ AfterAll: any;
45
+ };
46
+
47
+ type StepFunctionFixturesArg<
48
+ T extends KeyValue,
49
+ W extends KeyValue
50
+ > = FixturesArg<T, W>;
51
+ type StepFunction<T extends KeyValue, W extends KeyValue> = (
52
+ fixtures: StepFunctionFixturesArg<T, W>,
53
+ ...args: any[]
54
+ ) => unknown;
55
+
56
+ const { Given, Then, When, Step, And, But } = createBdd();
57
+
58
+ export { Given, Then, When, Step, And, But, expect, test, createBdd, Page };
12
59
 
13
60
  export * from '@playwright/test/types/test';
package/build/index.js CHANGED
@@ -7,13 +7,7 @@ exports.When = exports.Then = exports.Step = exports.Given = exports.But = expor
7
7
  Object.defineProperty(exports, "createBdd", {
8
8
  enumerable: true,
9
9
  get: function () {
10
- return _bddPoc.createBdd;
11
- }
12
- });
13
- Object.defineProperty(exports, "createNativeBDD", {
14
- enumerable: true,
15
- get: function () {
16
- return _bddPoc.createNativeBDD;
10
+ return _index.createBdd;
17
11
  }
18
12
  });
19
13
  Object.defineProperty(exports, "expect", {
@@ -29,19 +23,28 @@ Object.defineProperty(exports, "test", {
29
23
  }
30
24
  });
31
25
  var _index = require("./core/playwright/index");
32
- var _bddPoc = require("./bdd-poc");
26
+ // const { expect, test, createBdd } = require('./core/playwright/index');
27
+ // const { fireEvent, render } = require('@testing-library/react');
28
+
29
+ // module.exports = {
30
+ // expect,
31
+ // test,
32
+ // fireEvent,
33
+ // render,
34
+ // createBdd
35
+ // }
36
+
33
37
  // import { fireEvent, render } from '@testing-library/react';
38
+
34
39
  const {
35
40
  Given,
36
41
  Then,
37
42
  When,
38
- And,
39
- Step,
40
- But
41
- } = (0, _bddPoc.createBdd)();
42
- exports.But = But;
43
+ Step
44
+ } = (0, _index.createBdd)();
43
45
  exports.Step = Step;
44
- exports.And = And;
45
46
  exports.When = When;
46
47
  exports.Then = Then;
47
- exports.Given = Given;
48
+ exports.Given = Given;
49
+ const And = exports.And = Then;
50
+ const But = exports.But = Then;
package/build/lib/cli.js CHANGED
@@ -56,7 +56,7 @@ switch (option) {
56
56
  (0, _clearCaches.default)();
57
57
  break;
58
58
  }
59
- case 'lint-ci':
59
+ case 'lint':
60
60
  {
61
61
  _logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Linting Started ...');
62
62
  (0, _eslintLintStage.runEslintForDiff)(otherOptions).then(result => {
@@ -14,10 +14,7 @@ const reportRelativepath = path.relative(gitIgnoreAbsolutePath, reportPath)
14
14
  const absolutePathfeaturegen = path.resolve(process.cwd(), 'uat', '.features-gen');
15
15
  const featuregenRelativePath = path.relative(gitIgnoreAbsolutePath,absolutePathfeaturegen)
16
16
 
17
- const absolutePathScannerworkFolder = path.resolve(process.cwd(),'uat','.scanerwork')
18
- const scannerWorkPath = path.relative(gitIgnoreAbsolutePath,absolutePathScannerworkFolder)
19
-
20
- const dirpathtoIgnore = `/${testResultsRelativepath}\n/${reportRelativepath}\n/${featuregenRelativePath}\n/${scannerWorkPath}`
17
+ const dirpathtoIgnore = `${testResultsRelativepath}\n${reportRelativepath}\n${featuregenRelativePath}`
21
18
 
22
19
  function updateGitIgnore() {
23
20
  if (existsSync(path.resolve(process.cwd(), '../', '../', '.gitignore'))) {
@@ -5,15 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.checkIfFileExists = checkIfFileExists;
8
- exports.createFolderSync = createFolderSync;
9
8
  exports.deleteFile = deleteFile;
10
9
  exports.deleteFolder = deleteFolder;
11
10
  exports.readFileContents = readFileContents;
12
11
  exports.writeFileContents = writeFileContents;
13
- var _fs = _interopRequireWildcard(require("fs"));
12
+ var _fs = _interopRequireDefault(require("fs"));
14
13
  var _path = _interopRequireDefault(require("path"));
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
14
  function checkIfFileExists(file) {
18
15
  try {
19
16
  _fs.default.accessSync(file, _fs.default.constants.F_OK);
@@ -64,19 +61,4 @@ function deleteFolder(folderPath) {
64
61
  throw new Error(`Error while deleting the test data file: ${folderPath}`);
65
62
  }
66
63
  }
67
- }
68
- function resolveFilePath(...filePath) {
69
- var resolvedPath;
70
- for (let i = 0; i < filePath.length; i++) {
71
- resolvedPath = _path.default.resolve(resolvedPath, filePath[i]);
72
- }
73
- return resolvedPath;
74
- }
75
- function createFolderSync(folderPath, options = {}) {
76
- if ((0, _fs.existsSync)(folderPath)) {
77
- return null;
78
- }
79
- return (0, _fs.mkdirSync)(folderPath, {
80
- recursive: true
81
- });
82
64
  }
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getFilePathWithExtension;
7
- exports.isWindows = void 0;
8
7
  var _os = require("os");
9
- const isWindows = exports.isWindows = (0, _os.platform)().toLowerCase() === 'win32';
8
+ const isWindows = (0, _os.platform)().toLowerCase() === 'win32';
10
9
  function getFilePathWithExtension(binName) {
11
10
  return isWindows ? `${binName}.cmd` : binName;
12
11
  }