{"id":15994728,"url":"https://github.com/aars/machinepack-test-issue","last_synced_at":"2025-04-05T00:17:18.576Z","repository":{"id":136293725,"uuid":"42171748","full_name":"aars/machinepack-test-issue","owner":"aars","description":null,"archived":false,"fork":false,"pushed_at":"2015-09-09T10:39:32.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T08:32:39.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-09T10:23:49.000Z","updated_at":"2015-09-09T10:24:09.000Z","dependencies_parsed_at":"2023-03-13T07:00:55.523Z","dependency_job_id":null,"html_url":"https://github.com/aars/machinepack-test-issue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aars%2Fmachinepack-test-issue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aars%2Fmachinepack-test-issue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aars%2Fmachinepack-test-issue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aars%2Fmachinepack-test-issue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aars","download_url":"https://codeload.github.com/aars/machinepack-test-issue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266568,"owners_count":20910837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T07:10:02.711Z","updated_at":"2025-04-05T00:17:18.558Z","avatar_url":"https://github.com/aars.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### machinepack exec oddity\n`mp exec test --string='\"some.key\"' --object='{\"some\": {\"key\": \"Value!\"}}'`\n\nWithout `typeclass: '*'` on `inputs.object` `mp exec` results in errors. Apparently the custom `validate()` method\nis not used here.\n\n```\n[machinepack-inputsexampletest] mp exec test --string='\"some.key\"' --object='{\"some\": {\"key\": \"Value!\"}}'\n\nRunning machine...\n\nConsistency violation in run-machine-interactive: could not parse machine input value (object).\nError details:\n { [Error: 3 errors validating value:\n • For key `dot`: Expecting { notated: { key: 'string' } } (but got `undefined`)\n • For key `dot.notated`: Expecting { key: 'string' } (but got `undefined`)\n • For key `dot.notated.key`: Expecting 'string' (but got `undefined`)]\n  code: 'E_INVALID',\n  errors:\n   [ { [Error: For key `dot`: Expecting { notated: { key: 'string' } } (but got `undefined`)]\n       keyName: 'dot',\n       actual: undefined,\n       expected: [Object],\n       code: 'E_NOT_STRICTLY_VALID' },\n     { [Error: For key `dot.notated`: Expecting { key: 'string' } (but got `undefined`)]\n       keyName: 'dot.notated',\n       actual: undefined,\n       expected: [Object],\n       code: 'E_NOT_STRICTLY_VALID' },\n     { [Error: For key `dot.notated.key`: Expecting 'string' (but got `undefined`)]\n       keyName: 'dot.notated.key',\n       actual: undefined,\n       expected: 'string',\n       code: 'E_NOT_STRICTLY_VALID' } ] }\nUnexpected error occurred:\n Error: `run-machine` machine encountered 1 error(s) while validating runtime input values:  Error: 1 error validating value:\n • For key `value`: Expecting 'ref' (but got `undefined`)\n    at consolidateErrors (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/rttc/lib/helpers/consolidate-errors.js:45:13)\n    at Object.validate (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/rttc/lib/validate.js:33:13)\n    at /Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/validate-configured-input-values.js:226:34\n    at /Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/lodash/index.js:3073:15\n    at baseForOwn (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/lodash/index.js:2046:14)\n    at /Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/lodash/index.js:3043:18\n    at Function.\u003canonymous\u003e (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/node_modules/lodash/index.js:3346:13)\n    at validateConfiguredInputValues (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/validate-configured-input-values.js:31:5)\n    at Machine_prototype_exec [as exec] (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/Machine.prototype.exec.js:45:29)\n    at Object.Machine.build.exec.success (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machinepack-localmachinepacks/machines/run-machine-interactive.js:206:12)\n    at /Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/Machine.prototype.exec.js:58:21\n    at Machine_prototype_exec [as exec] (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/Machine.prototype.exec.js:66:11)\n    at Object.Machine.build.exec.success (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machinepack-localmachinepacks/machines/run-machine-interactive.js:206:12)\n    at afterwards (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/intercept-exit-callbacks.js:160:21)\n    at null._onTimeout (/Users/aaronh/.nvm/versions/node/v0.12.7/lib/node_modules/machinepack/node_modules/machine/lib/intercept-exit-callbacks.js:111:20)\n    at Timer.listOnTimeout (timers.js:119:15)\n```\n\n### test-machinepack-mocha oddity\n\nWhen running tests using `test-machinepack-mocha` (the default `npm test` setup) the given `object` input does\nnot reach the `fn`. Somehow the first level of the `example` objects is passed in.\n\n```\n[machinepack-inputsexampletest] npm test                                                     master  ✭\n\n\u003e machinepack-inputsexampletest@0.1.0 test /Users/aaronh/dev/rxs/machinepack-inputsexampletest\n\u003e node ./node_modules/test-machinepack-mocha/bin/testmachinepack-mocha.js\n\n\n\n  `test` machine\nTHE INPUTS: { string: 'some.key', object: { dot: undefined } }\n    ✓ should exit with `success` given input values: `{\"string\":\"some.key\",\"object\":{\"some\":{\"key\":\"Value!\"}}}` (47ms)\n\n\n  1 passing (56ms)\n```\n\nAs you can see, `console.log(inputs)` does not contain what the test says it passed in.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faars%2Fmachinepack-test-issue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faars%2Fmachinepack-test-issue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faars%2Fmachinepack-test-issue/lists"}