@carbonorm/carbonreact 3.3.5 → 3.3.7

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/dist/index.esm.js CHANGED
@@ -4246,7 +4246,7 @@ function setUrl(host = 'www.example.com', https = false) {
4246
4246
  }
4247
4247
 
4248
4248
  const validSQL = [];
4249
- function validSQL$1 (sql) {
4249
+ function ValidSQL (sql) {
4250
4250
  const { expect } = require("@jest/globals");
4251
4251
  validSQL.push({ [expect.getState().currentTestName.replaceAll(" ", "_").toLowerCase()]: sql });
4252
4252
  }
@@ -4258,6 +4258,12 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
4258
4258
  const validSqlFile = () => sqlDirectory + testName() + '.json';
4259
4259
  const logsFile = () => logsDirectory + testName() + '.log';
4260
4260
  expect(document).not.toBeNull();
4261
+ axiosInstance.interceptors.response.use(response => {
4262
+ if (Array.isArray(response?.data?.sql)) {
4263
+ ValidSQL(response.data.sql);
4264
+ }
4265
+ return response;
4266
+ });
4261
4267
  // @link https://stackoverflow.com/questions/13542667/create-directory-when-writing-to-file-in-node-js
4262
4268
  const asyncFileLogging = async (...args) => fs.writeFileSync(logsFile(), '\n' + inspect(args.length === 1 ? args.pop() : args, false, 10, true), { flag: "a+" });
4263
4269
  global.console = {
@@ -4282,7 +4288,7 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
4282
4288
  expect(checkAllRequestsComplete()).toEqual(true);
4283
4289
  }, { timeout: 3000, interval: 1000 });
4284
4290
  const jsonSQL = JSON.stringify(validSQL, undefined, 2) ?? '';
4285
- console.log('After each Test (' + expect.getState().currentTestName + ') + (' + jsonSQL + ')', expect.getState());
4291
+ console.log('After each Test (' + expect.getState().currentTestName + ')', validSQL, expect.getState());
4286
4292
  // restore `window.location` to the original `jsdom`
4287
4293
  // `Location` object
4288
4294
  window.location = originalWindowLocation;
@@ -4471,5 +4477,5 @@ function useWindowDimensions() {
4471
4477
  return windowDimensions;
4472
4478
  }
4473
4479
 
4474
- export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, validSQL$1 as validSQL, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
4480
+ export { AccessDenied, Alert, BackendThrowable, C6, COLUMNS, CarbonReact, ErrorHttpCode, GlobalHistory, Loading, Nest, PageNotFound, Popup, TABLES, addAlert, addValidSQL$1 as addValidSQL, carbons, changed, comments, deleteRestfulObjectArrays, documentation, eUpdateInsertMethod, feature_group_references, features, getRootStyleValue, getStyles, globalNavigate, group_references, groups, hexToRgb, history_logs, initialCarbonReactState, initialRequiredCarbonORMState, initialRestfulObjectsState, isEdgeBrowser, isProduction, location_references, locations, parseMultipleJson, photos, range, reports, ScrollIntoViewDirective as scrollIntoView, setCookies, setUrl, setupTests, toDataURL, updateRestfulObjectArrays, uploadImage, uploadImageChange, user_followers, user_groups, user_messages, user_sessions, user_tasks, users, ValidSQL as validSQL, useWindowDimensions as windowDimensions, wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_term_relationships, wp_term_taxonomy, wp_termmeta, wp_terms, wp_usermeta, wp_users };
4475
4481
  //# sourceMappingURL=index.esm.js.map