@lokalise/playwright-reporters 1.8.0 → 1.8.1

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.
@@ -75,6 +75,9 @@ class TranslationReporter {
75
75
  if (!testProjectName?.toLowerCase().includes('shopify')) {
76
76
  return;
77
77
  }
78
+ if (['skipped', 'interrupted'].includes(result.status)) {
79
+ return;
80
+ }
78
81
  const testId = `${test.id}-${result.retry ?? 0}`;
79
82
  // No need to calculate totalImportDuration here; it's already accumulated
80
83
  this.listOfTests.data[testId] = {
@@ -23,9 +23,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ /* eslint-disable max-statements */
26
27
  const test_1 = __importStar(require("@playwright/test"));
27
28
  const reporter_1 = __importStar(require("../reporter"));
28
29
  test_1.default.describe('TranslationReporter Unit Tests', () => {
30
+ test_1.default.describe.configure({ mode: 'parallel' });
29
31
  let reporter;
30
32
  test_1.default.beforeEach(async () => {
31
33
  reporter = new reporter_1.default({
@@ -37,7 +39,6 @@ test_1.default.describe('TranslationReporter Unit Tests', () => {
37
39
  });
38
40
  });
39
41
  test_1.default.describe('onStepEnd', () => {
40
- // eslint-disable-next-line max-statements
41
42
  (0, test_1.default)('should correctly accumulate data for importing step', () => {
42
43
  const testCase = {
43
44
  id: 'test-id',
@@ -95,7 +96,7 @@ test_1.default.describe('TranslationReporter Unit Tests', () => {
95
96
  timestamp_: 0,
96
97
  });
97
98
  });
98
- (0, test_1.default)('should not accumulate data for non-Shopify tests', () => {
99
+ (0, test_1.default)('should not accumulate data for non-Shopify project, with valid Shopify steps', () => {
99
100
  const testCase = {
100
101
  id: 'test-id',
101
102
  title: 'Non-Shopify Test',
@@ -107,8 +108,8 @@ test_1.default.describe('TranslationReporter Unit Tests', () => {
107
108
  retry: 0,
108
109
  };
109
110
  const testStep = {
110
- title: 'Some Step',
111
- duration: 400,
111
+ title: reporter_1.ShopifySteps.importing,
112
+ duration: 50,
112
113
  };
113
114
  reporter.onStepEnd(testCase, testResult, testStep);
114
115
  const testId = `${testCase.id}-${testResult.retry ?? 0}`;
@@ -158,5 +159,43 @@ test_1.default.describe('TranslationReporter Unit Tests', () => {
158
159
  const resultData = reporter.listOfTests.data[testId];
159
160
  (0, test_1.expect)(resultData).toBeUndefined();
160
161
  });
162
+ (0, test_1.default)('should skip test result accumulation for skipped tests', async () => {
163
+ const testCase = {
164
+ id: 'test-id',
165
+ title: 'Shopify Test',
166
+ parent: {
167
+ project: () => ({ name: 'shopify' }),
168
+ },
169
+ };
170
+ const testResult = {
171
+ retry: 0,
172
+ status: 'skipped',
173
+ startTime: new Date(),
174
+ duration: 600,
175
+ };
176
+ await reporter.onTestEnd(testCase, testResult);
177
+ const testId = `${testCase.id}-${testResult.retry ?? 0}`;
178
+ const resultData = reporter.listOfTests.data[testId];
179
+ (0, test_1.expect)(resultData).toBeUndefined();
180
+ });
181
+ (0, test_1.default)('should skip test result accumulation for interrupted tests', async () => {
182
+ const testCase = {
183
+ id: 'test-id',
184
+ title: 'Shopify Test',
185
+ parent: {
186
+ project: () => ({ name: 'shopify' }),
187
+ },
188
+ };
189
+ const testResult = {
190
+ retry: 0,
191
+ status: 'interrupted',
192
+ startTime: new Date(),
193
+ duration: 600,
194
+ };
195
+ await reporter.onTestEnd(testCase, testResult);
196
+ const testId = `${testCase.id}-${testResult.retry ?? 0}`;
197
+ const resultData = reporter.listOfTests.data[testId];
198
+ (0, test_1.expect)(resultData).toBeUndefined();
199
+ });
161
200
  });
162
201
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/playwright-reporters",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "scripts": {
5
5
  "lint:eslint": "eslint --cache . --ext .js,.cjs,.ts",
6
6
  "lint:ts": "tsc --noEmit",
@@ -55,29 +55,29 @@
55
55
  "access": "public"
56
56
  },
57
57
  "devDependencies": {
58
- "@commitlint/cli": "19.4.0",
59
- "@commitlint/config-conventional": "19.2.2",
60
- "@commitlint/prompt-cli": "19.4.0",
58
+ "@commitlint/cli": "19.5.0",
59
+ "@commitlint/config-conventional": "19.5.0",
60
+ "@commitlint/prompt-cli": "19.5.0",
61
61
  "@lokalise/eslint-config-frontend": "^4.6.1",
62
62
  "@lokalise/prettier-config": "^1.0.1",
63
63
  "@semantic-release/changelog": "6.0.3",
64
64
  "@semantic-release/commit-analyzer": "13.0.0",
65
65
  "@semantic-release/git": "10.0.1",
66
- "@semantic-release/github": "10.1.6",
66
+ "@semantic-release/github": "10.3.4",
67
67
  "@semantic-release/npm": "12.0.1",
68
68
  "@semantic-release/release-notes-generator": "14.0.1",
69
69
  "@types/lodash": "^4.17.7",
70
- "@types/node": "^22.3.0",
70
+ "@types/node": "^22.5.5",
71
71
  "eslint-config-prettier": "^9.1.0",
72
72
  "eslint-plugin-prettier": "^5.2.1",
73
- "husky": "9.1.4",
73
+ "husky": "9.1.6",
74
74
  "prettier": "^3.3.3",
75
- "semantic-release": "24.0.0",
76
- "typescript": "5.5.4"
75
+ "semantic-release": "24.1.1",
76
+ "typescript": "5.6.2"
77
77
  },
78
78
  "dependencies": {
79
- "@faker-js/faker": "^8.4.1",
80
- "@playwright/test": "^1.46.0",
79
+ "@faker-js/faker": "^9.0.1",
80
+ "@playwright/test": "^1.47.1",
81
81
  "fastest-levenshtein": "^1.0.16",
82
82
  "lodash": "^4.17.21"
83
83
  },