@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.cjs.js +9 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/hoc/setupTests.tsx +19 -4
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
|
|
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 = {
|
|
@@ -4284,7 +4290,7 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
|
|
|
4284
4290
|
expect(carbonnode.checkAllRequestsComplete()).toEqual(true);
|
|
4285
4291
|
}, { timeout: 3000, interval: 1000 });
|
|
4286
4292
|
const jsonSQL = JSON.stringify(validSQL, undefined, 2) ?? '';
|
|
4287
|
-
console.log('After each Test (' + expect.getState().currentTestName + ')
|
|
4293
|
+
console.log('After each Test (' + expect.getState().currentTestName + ')', validSQL, expect.getState());
|
|
4288
4294
|
// restore `window.location` to the original `jsdom`
|
|
4289
4295
|
// `Location` object
|
|
4290
4296
|
window.location = originalWindowLocation;
|
|
@@ -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 =
|
|
4535
|
+
exports.validSQL = ValidSQL;
|
|
4530
4536
|
exports.windowDimensions = useWindowDimensions;
|
|
4531
4537
|
exports.wp_commentmeta = wp_commentmeta;
|
|
4532
4538
|
exports.wp_comments = wp_comments;
|