@carbonorm/carbonreact 3.3.7 → 3.3.9
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/compileValidSQL.cjs +11 -4
- package/compileValidSQL.tsx +14 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/hoc/setupTests.tsx +1 -1
package/compileValidSQL.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
2
3
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
4
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
5
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,7 +36,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
36
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
var fs_1 = require("fs");
|
|
39
41
|
var c = require('ansi-colors');
|
|
40
42
|
// Create an object to store the parsed arguments
|
|
41
43
|
var args = {
|
|
@@ -82,7 +84,7 @@ if (args.verbose) {
|
|
|
82
84
|
var util = require('util');
|
|
83
85
|
var exec = util.promisify(require('child_process').exec);
|
|
84
86
|
var fs = require('fs');
|
|
85
|
-
(function () { return __awaiter(
|
|
87
|
+
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
88
|
var jsonValidSqlFiles, validExternalRequests, ManifestFile, stdout, revision;
|
|
87
89
|
return __generator(this, function (_a) {
|
|
88
90
|
switch (_a.label) {
|
|
@@ -93,8 +95,13 @@ var fs = require('fs');
|
|
|
93
95
|
if (file === ManifestFile) {
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
|
-
var resource =
|
|
97
|
-
|
|
98
|
+
var resource = (0, fs_1.readFileSync)("".concat(args.outputDir).concat(file), 'utf8');
|
|
99
|
+
var json = JSON.parse(resource);
|
|
100
|
+
if (json === undefined) {
|
|
101
|
+
console.error("Failed to parse ".concat(file, " as JSON"));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
jsonValidSqlFiles.push(json);
|
|
98
105
|
});
|
|
99
106
|
jsonValidSqlFiles.forEach(function (apiRequest) {
|
|
100
107
|
Object.keys(apiRequest).forEach(function (testName) {
|
package/compileValidSQL.tsx
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import {readFile, readFileSync} from "fs";
|
|
4
|
+
|
|
3
5
|
const c = require('ansi-colors');
|
|
4
6
|
|
|
5
7
|
// Create an object to store the parsed arguments
|
|
@@ -91,9 +93,19 @@ const fs = require('fs');
|
|
|
91
93
|
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
const resource =
|
|
96
|
+
const resource = readFileSync(`${args.outputDir}${file}`, 'utf8');
|
|
97
|
+
|
|
98
|
+
const json = JSON.parse(resource)
|
|
99
|
+
|
|
100
|
+
if (json === undefined) {
|
|
101
|
+
|
|
102
|
+
console.error(`Failed to parse ${file} as JSON`);
|
|
103
|
+
|
|
104
|
+
return;
|
|
105
|
+
|
|
106
|
+
}
|
|
95
107
|
|
|
96
|
-
jsonValidSqlFiles.push(
|
|
108
|
+
jsonValidSqlFiles.push(json);
|
|
97
109
|
|
|
98
110
|
});
|
|
99
111
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -4289,7 +4289,7 @@ function setupTests ({ sqlDirectory = './logs/rest/', logsDirectory = './logs/te
|
|
|
4289
4289
|
await react$1.waitFor(async () => {
|
|
4290
4290
|
expect(carbonnode.checkAllRequestsComplete()).toEqual(true);
|
|
4291
4291
|
}, { timeout: 3000, interval: 1000 });
|
|
4292
|
-
const jsonSQL = JSON.stringify(validSQL, undefined, 2) ?? '';
|
|
4292
|
+
const jsonSQL = JSON.stringify(validSQL, undefined, 2) ?? '{}';
|
|
4293
4293
|
console.log('After each Test (' + expect.getState().currentTestName + ')', validSQL, expect.getState());
|
|
4294
4294
|
// restore `window.location` to the original `jsdom`
|
|
4295
4295
|
// `Location` object
|