@carbonorm/carbonreact 3.3.6 → 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.cjs.js CHANGED
@@ -4248,7 +4248,7 @@ function setUrl(host = 'www.example.com', https = false) {
4248
4248
  }
4249
4249
 
4250
4250
  const validSQL = [];
4251
- function validSQL$1 (sql) {
4251
+ function ValidSQL (sql) {
4252
4252
  const { expect } = require("@jest/globals");
4253
4253
  validSQL.push({ [expect.getState().currentTestName.replaceAll(" ", "_").toLowerCase()]: sql });
4254
4254
  }
@@ -4260,6 +4260,12 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
4260
4260
  const validSqlFile = () => sqlDirectory + testName() + '.json';
4261
4261
  const logsFile = () => logsDirectory + testName() + '.log';
4262
4262
  expect(document).not.toBeNull();
4263
+ carbonnode.axiosInstance.interceptors.response.use(response => {
4264
+ if (Array.isArray(response?.data?.sql)) {
4265
+ ValidSQL(response.data.sql);
4266
+ }
4267
+ return response;
4268
+ });
4263
4269
  // @link https://stackoverflow.com/questions/13542667/create-directory-when-writing-to-file-in-node-js
4264
4270
  const asyncFileLogging = async (...args) => fs.writeFileSync(logsFile(), '\n' + util.inspect(args.length === 1 ? args.pop() : args, false, 10, true), { flag: "a+" });
4265
4271
  global.console = {
@@ -4526,7 +4532,7 @@ exports.user_messages = user_messages;
4526
4532
  exports.user_sessions = user_sessions;
4527
4533
  exports.user_tasks = user_tasks;
4528
4534
  exports.users = users;
4529
- exports.validSQL = validSQL$1;
4535
+ exports.validSQL = ValidSQL;
4530
4536
  exports.windowDimensions = useWindowDimensions;
4531
4537
  exports.wp_commentmeta = wp_commentmeta;
4532
4538
  exports.wp_comments = wp_comments;