@zohodesk/testinglibrary 0.1.8-stb-bdd-v7 → 0.1.8-stb-bdd-v8

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.
@@ -9,13 +9,10 @@ exports.tagProcessor = tagProcessor;
9
9
  var _logger = require("../../utils/logger");
10
10
  /* eslint-disable dot-notation */
11
11
 
12
- function getTagsString(tags, editionTags) {
13
- return {
14
- tags: tags || null,
15
- editionTags: editionTags || null
16
- };
17
- // return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
18
- }
12
+ // function getTagsString(tags, editionTags) {
13
+ // return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
14
+ // }
15
+
19
16
  function getEdition(edition) {
20
17
  if (edition.startsWith('<=')) {
21
18
  return ['<=', edition.slice(2)];
@@ -49,13 +46,13 @@ function editionPreprocessing(editionOrder, selectedEdition) {
49
46
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions ${selectedEdition} found. Running with default edition`);
50
47
  return [];
51
48
  }
52
- function buildEditionTags(editionArgs, operator) {
53
- return editionArgs.map(edition => `@edition_${edition}`).join(` ${operator} `);
49
+ function buildEditionTags(editionArgs, operator, prefix = "") {
50
+ return editionArgs.map(edition => `${prefix}${edition}`).join(` ${operator} `);
54
51
  }
55
52
  function tagProcessor(userArgsObject, editionOrder) {
56
53
  let filteredTags;
57
54
  let tagArgs = userArgsObject['tags'];
58
- let multiTags = userArgsObject['tags'];
55
+ let multiTags = userArgsObject['tags'] || " ";
59
56
  if (multiTags.split(',').length >= 2) {
60
57
  tagArgs = buildEditionTags(multiTags.split(','), '|');
61
58
  }
@@ -65,20 +62,18 @@ function tagProcessor(userArgsObject, editionOrder) {
65
62
  if (editionsArray.length === 1) {
66
63
  const editionArgs = editionPreprocessing(editionOrder, edition);
67
64
  if (editionArgs && editionArgs.length > 0) {
68
- const editionTags = buildEditionTags(editionArgs, '|');
69
- filteredTags = getTagsString(tagArgs, editionTags);
65
+ const editionTags = buildEditionTags(editionArgs, '|', "@edition_");
66
+ filteredTags = editionTags;
70
67
  }
71
68
  } else {
72
69
  // More than one edition given
73
70
  const filteredEditions = editionOrder.filter(edition => !editionsArray.includes(edition));
74
- const editionTags = buildEditionTags(filteredEditions, '|');
75
- filteredTags = getTagsString(tagArgs, editionTags);
71
+ const editionTags = buildEditionTags(filteredEditions, '|', "@edition_");
72
+ filteredTags = editionTags;
76
73
  }
77
- } else {
78
- filteredTags = {
79
- tags: tagArgs,
80
- editionTags: []
81
- };
82
74
  }
83
- return filteredTags;
75
+ return {
76
+ tags: tagArgs,
77
+ editionTags: filteredTags
78
+ };
84
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "0.1.8-stb-bdd-v7",
3
+ "version": "0.1.8-stb-bdd-v8",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {