@k-int/stripes-kint-components 5.28.1 → 5.28.3

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [5.28.3](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.28.2...v5.28.3) (2025-11-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **parseErrorResponse:** Ensure when headers aren't present that we still attempt to resolve an error type (default to application/text) ([fa134d8](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/fa134d8224381bf6cdf3e4bf53d8d0a575c9f541))
7
+
8
+ ## [5.28.2](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.28.1...v5.28.2) (2025-10-29)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * CI Pipeline always runs tests ([071890a](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/commit/071890ad1195c0e491c47fae6d9edf7b1914fb85))
14
+
1
15
  ## [5.28.1](https://gitlab.com/knowledge-integration/folio/stripes-kint-components/compare/v5.28.0...v5.28.1) (2025-10-28)
2
16
 
3
17
 
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  const parseErrorResponse = async responseObj => {
8
- var _ref;
8
+ var _find$, _ref, _responseObj$headers;
9
9
  let errorResp = {
10
10
  message: 'something went wrong'
11
11
  };
@@ -13,7 +13,9 @@ const parseErrorResponse = async responseObj => {
13
13
  return errorResp;
14
14
  }
15
15
  const code = responseObj === null || responseObj === void 0 ? void 0 : responseObj.status;
16
- const contentType = (_ref = [...(responseObj === null || responseObj === void 0 ? void 0 : responseObj.headers)]) === null || _ref === void 0 || (_ref = _ref.find(header => header[0] === 'content-type')) === null || _ref === void 0 ? void 0 : _ref[1];
16
+
17
+ // Assume text if we can't find content type
18
+ const contentType = (_find$ = (_ref = [...((_responseObj$headers = responseObj === null || responseObj === void 0 ? void 0 : responseObj.headers) !== null && _responseObj$headers !== void 0 ? _responseObj$headers : [])]) === null || _ref === void 0 || (_ref = _ref.find(header => header[0] === 'content-type')) === null || _ref === void 0 ? void 0 : _ref[1]) !== null && _find$ !== void 0 ? _find$ : 'application/text';
17
19
  if (contentType.includes('json')) {
18
20
  errorResp = await responseObj.json();
19
21
  } else {
package/jest.config.js CHANGED
@@ -8,11 +8,13 @@ const thisConfig = {
8
8
  testEnvironment: 'jsdom',
9
9
  transform: { '^.+\\.(js|jsx)$': path.join(__dirname, './test/jest/jest-transformer.js') },
10
10
  moduleDirectories: ['node_modules'],
11
- modulePathIgnorePatterns: ["<rootDir>/.*/__mocks__"],
11
+ modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],
12
12
  setupFiles: [
13
13
  path.join(__dirname, './test/jest/setupTests.js')
14
14
  ],
15
15
  resolver: path.join(__dirname, './test/jest/resolver.js'),
16
+ 'reporters': ['default', 'jest-junit'],
17
+ coverageReporters: ['html', 'text', 'text-summary', 'cobertura'],
16
18
  };
17
19
 
18
20
  module.exports = thisConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "5.28.1",
3
+ "version": "5.28.3",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "lint": "eslint src --resolve-plugins-relative-to ./node_modules/@folio/eslint-config-stripes/",
11
11
  "test": "yarn run test:jest",
12
- "test:jest": "jest --ci --coverage --maxWorkers=50%",
12
+ "test:jest": "jest --ci --coverage --maxWorkers=50% --reporters=default --reporters=jest-junit",
13
13
  "build:es": "rm -rf ./es && babel --extensions .js --ignore ./src/**/tests/**/* ./src --out-dir es",
14
14
  "build": "yarn build:es",
15
15
  "clean": "rm -rf ./node_modules ./*/node_modules ./yarn.lock && yarn install --ignore-scripts",
@@ -60,6 +60,7 @@
60
60
  "eslint-plugin-jest": "^28.0.0",
61
61
  "graphql": "^16.0.0",
62
62
  "identity-obj-proxy": "^3.0.0",
63
+ "jest-junit": "^16.0.0",
63
64
  "prop-types-extra": ">=1.1.0",
64
65
  "react": "^18.2.0",
65
66
  "react-dom": "^18.2.0",
@@ -4,7 +4,9 @@ const parseErrorResponse = async (responseObj) => {
4
4
  return errorResp;
5
5
  }
6
6
  const code = responseObj?.status;
7
- const contentType = [...responseObj?.headers]?.find(header => header[0] === 'content-type')?.[1];
7
+
8
+ // Assume text if we can't find content type
9
+ const contentType = [...(responseObj?.headers ?? [])]?.find(header => header[0] === 'content-type')?.[1] ?? 'application/text';
8
10
 
9
11
  if (contentType.includes('json')) {
10
12
  errorResp = await responseObj.json();