theprogrammablemind_4wp 9.3.0-beta.54 → 9.3.0-beta.55
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/client.js +7 -5
- package/package.json +1 -1
- package/src/config.js +20 -0
package/client.js
CHANGED
@@ -50,8 +50,8 @@ const getConfig_getContextCheck = (testConfig) => {
|
|
50
50
|
return (testConfig.checks && testConfig.checks.context) || []
|
51
51
|
}
|
52
52
|
|
53
|
-
const pickContext = (
|
54
|
-
return project2(context,
|
53
|
+
const pickContext = (contextChecks) => (context) => {
|
54
|
+
return project2(context, contextChecks)
|
55
55
|
}
|
56
56
|
|
57
57
|
const pickObjects = (config, testConfig, getObjects) => {
|
@@ -520,8 +520,9 @@ const runTest = async (config, expected, { args, verbose, testConfig, debug, tim
|
|
520
520
|
failed_generatedParenthesized = false
|
521
521
|
}
|
522
522
|
|
523
|
-
const
|
524
|
-
const
|
523
|
+
const contextChecks = config.getContextChecks()
|
524
|
+
const pickedResultContexts = result.contexts.map(pickContext(contextChecks))
|
525
|
+
const pickedExpectedContexts = expected.contexts.map(pickContext(contextChecks))
|
525
526
|
const failedCheckedContexts = !matching(pickedResultContexts, pickedExpectedContexts)
|
526
527
|
|
527
528
|
const expectedGetObjects = (name) => {
|
@@ -885,7 +886,8 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
|
|
885
886
|
console.log(JSON.stringify(picked, null, 2))
|
886
887
|
}
|
887
888
|
|
888
|
-
const
|
889
|
+
const contextChecks = config.getContextChecks()
|
890
|
+
const pickedResultContexts = responses.contexts.map(pickContext(contextChecks))
|
889
891
|
if (pickedResultContexts.some((context) => Object.keys(context).length > 0)) {
|
890
892
|
console.log('--- Contexts showing only the checked values ---')
|
891
893
|
console.log(JSON.stringify(pickedResultContexts, null, 2))
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -878,6 +878,7 @@ class Config {
|
|
878
878
|
getInfo () {
|
879
879
|
const name = this.name
|
880
880
|
const includes = this.configs.slice(1).map((km) => km.config.name)
|
881
|
+
includes.sort()
|
881
882
|
const visibleExamples = []
|
882
883
|
for (const test of this.tests) {
|
883
884
|
if (!test.developerTest) {
|
@@ -2596,6 +2597,24 @@ class Config {
|
|
2596
2597
|
})
|
2597
2598
|
}
|
2598
2599
|
|
2600
|
+
getContextChecks() {
|
2601
|
+
const allChecks = []
|
2602
|
+
for (const name of this.loadOrdering) {
|
2603
|
+
const checks = this.kms[name].testConfig?.checks?.context || []
|
2604
|
+
for (const check of checks) {
|
2605
|
+
if (check.exported) {
|
2606
|
+
allChecks.push(check)
|
2607
|
+
}
|
2608
|
+
}
|
2609
|
+
}
|
2610
|
+
for (const check of this.testConfig?.checks?.context || []) {
|
2611
|
+
if (!check.exported) {
|
2612
|
+
allChecks.push(check)
|
2613
|
+
}
|
2614
|
+
}
|
2615
|
+
return allChecks
|
2616
|
+
}
|
2617
|
+
|
2599
2618
|
// rebuild ({ isModule: mainIsModule = false } = {}) {
|
2600
2619
|
async rebuild ({ isModule: mainIsModule } = {}) {
|
2601
2620
|
if (this._stop_auto_rebuild) {
|
@@ -2623,6 +2642,7 @@ class Config {
|
|
2623
2642
|
// reorder configs base on load ordering
|
2624
2643
|
{
|
2625
2644
|
const ordering = this.loadOrder.order(this.configs.map((km) => km.name || km.uuid))
|
2645
|
+
this.loadOrdering = ordering
|
2626
2646
|
const oconfigs = []
|
2627
2647
|
for (const nameOrUUID of ordering) {
|
2628
2648
|
for (const km of this.configs) {
|