{"_id":"@alotela/mf-maestro-tester","_rev":"2-2c95212bfd7887d600a5820f0e11d4cd","name":"@alotela/mf-maestro-tester","dist-tags":{"latest":"0.0.12"},"versions":{"0.0.11":{"author":{"name":"Charlie Eissen"},"description":"a tool to test and develop MfMaestro compatible microfrontends","dependencies":{"fast-deep-equal":"^3.1.3","json5":"^2.2.0"},"devDependencies":{"@babel/core":"^7.15.0","@babel/preset-env":"^7.15.0","babel-loader":"^8.2.2","npm-check-updates":"^11.8.3","testcafe":"^1.15.3","webpack":"^5.51.1","webpack-cli":"^4.8.0","webpack-dev-server":"^4.0.0"},"keywords":["microservices","microfrontends"],"license":"ISC","main":"./dist/index.js","name":"@alotela/mf-maestro-tester","repository":{"type":"git","url":"git+https://github.com/alotela/mf-maestro-tester.git"},"scripts":{"build":"rm -rf dist/ && webpack --mode production","prepare":"rm -rf dist/ && npm run build","start":"rm -rf dist/ && webpack-dev-server --mode development","stop":"kill $(ps aux | grep '[w]ebpack-dev-server' | awk '{print $2}')","test":"(npm start &) && testcafe chrome:headless ./tests/*.test.js && npm run stop"},"version":"0.0.11","gitHead":"7398ef318aa2601f1f337a47c7bb7d433d1d4aec","bugs":{"url":"https://github.com/alotela/mf-maestro-tester/issues"},"homepage":"https://github.com/alotela/mf-maestro-tester#readme","_id":"@alotela/mf-maestro-tester@0.0.11","_nodeVersion":"14.17.1","_npmVersion":"7.19.1","dist":{"integrity":"sha512-NSXfVWQxHOFWZzp1+hN0iUM/I+I6D5Yxx7ekW/fj4FSJr6aTMVO49k2Rolet/AI0SINJvuxL4LQDgA6GHl/+7A==","shasum":"4949d99f1c8a442fbc65861a12c77d1a481bbf41","tarball":"https://registry.npmjs.org/@alotela/mf-maestro-tester/-/mf-maestro-tester-0.0.11.tgz","fileCount":3,"unpackedSize":167781,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI5QqCRA9TVsSAnZWagAAbz8P/1fUA5JI5AGLlheAMuut\nX+QZs7P+rBS5ZI733H2U4ljBHBQbQPhet5KU4vGKaF/VKAeFN4hHAxc5OPnV\nRm3vSoWqVyVhXgCyO+4ocw1zg+4C4YEk6KOofZKfdgICTXniSYCtUaYP0dLY\nZE9AEK8Lx3EXK2uGKezu76WHYEYzXXDRJYCldkdHY6H4m+6No8Im159+k6JD\nhW8BI0dGTLJrPsSD0J6Lx7Xc9ifwHp1gfh8FEDDi7Z84/4J9501oGCXTS4+H\n+lfSIzOd15X07Xgx67omcMyrAjbjenjIuvyb7KIuRgOmysF+S1X4bkO2sp3E\nZDSb3lPbzrgTlWPHHY7sjUHqKYOYF72bOL6C9ODmYNP0Nhu0aGAlepQDWAar\nrrKkZJuVaL5MytY05ebT0OiRdf/uPYDysMlA2GLP3NlreqfXU6FqZthEc2JK\nbPURTEQVbjm/NBUp3l3kPTI8RK7ptisp3lLcAyG61wKW29wF5G1enmPe7N2b\nm+303scEQnjpNsH++AVndwtdud0LYzg5eixgKs89YNSFwqorbDttwjdkSciO\n4zBXZP9vVvX9HfDiTh3SfRA9/L17VlthPxLRBalW1CltkSzJwCbOafGzKOIY\nEAODObVupqpcc6u0ywFMJ6jI1bmTFCJnUlTY450C1TeJ+PSTk9VBUKb8Kdc1\nFtlV\r\n=4nui\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCam6wvWH54QlyNIt5E1cuVP/0/zED6fRunZGz+rmHnXwIgMmwWchDCwjTJEeEiyDlhEWcONm3kWATTXt9wPyBtfGk="}]},"_npmUser":{"name":"ceissen","email":"postmaster@papayecube.com"},"directories":{},"maintainers":[{"name":"ceissen","email":"postmaster@papayecube.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mf-maestro-tester_0.0.11_1629721642727_0.5580626530533253"},"_hasShrinkwrap":false},"0.0.12":{"author":{"name":"Charlie Eissen"},"description":"a tool to test and develop MfMaestro compatible microfrontends","dependencies":{"fast-deep-equal":"^3.1.3","json5":"^2.1.3"},"devDependencies":{"@babel/core":"^7.10.2","@babel/preset-env":"^7.10.2","babel-loader":"^8.1.0","testcafe":"^1.8.6","webpack":"^4.43.0","webpack-cli":"^3.3.11","webpack-dev-server":"^3.11.0"},"keywords":["microservices","microfrontends"],"license":"ISC","main":"./dist/index.js","name":"@alotela/mf-maestro-tester","repository":{"type":"git","url":"git+https://github.com/alotela/mf-maestro-tester.git"},"scripts":{"build":"rm -rf dist/ && webpack --mode production","prepare":"rm -rf dist/ && npm run build","start":"rm -rf dist/ && webpack-dev-server --mode development","stop":"kill $(ps aux | grep '[w]ebpack-dev-server' | awk '{print $2}')","test":"(npm start &) && testcafe chrome:headless ./tests/*.test.js && npm run stop"},"version":"0.0.12","gitHead":"cdccd1fd496000b1cf287ef6ef851f8d3aedcdcb","bugs":{"url":"https://github.com/alotela/mf-maestro-tester/issues"},"homepage":"https://github.com/alotela/mf-maestro-tester#readme","_id":"@alotela/mf-maestro-tester@0.0.12","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-TqyxsrI9LcA+u1z8Yio5WYMmWpMTaWQ5Eln6NQ2XJe/CwQ7yXN586RhFyuQLYglu6pYcx6j/X35StEDQn64JKg==","shasum":"15c3456d51ce46690321c3b3603ad6e10478a0a3","tarball":"https://registry.npmjs.org/@alotela/mf-maestro-tester/-/mf-maestro-tester-0.0.12.tgz","fileCount":3,"unpackedSize":170468,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEMX/vwzRlYmnfIfx5VS0jOrKy/GWZWR7uGiPft73y+sAiBu0SThWHlVksLWBe4ay8asRm1OiLW8B0XoQFeVS5Bfng=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi48OhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQ7Q//UM1L3paAeKky1+3ECI+0uuOBkBZSSBnLGPVpNlWUbYHzYTp1\r\n7CuhC2B9KIkasbZtSEk+Ex8k+QVBxNqZs1yl7tkuk06sqdXXPeH3vCKWCuVF\r\nt1evfNmhBgoqVehUPGlz3h1Ekv4bfuoRViMNwRaHn8qFRMOljNOXaMsUAFTQ\r\nxPXpJx/IlJLTJeAFH/Vl42ob+4kCLZsu8MvgOgNIqWjoEOWjT0lf2b8JGOoZ\r\n8y+1GvyxeQChC+jAppAFBsd5kKYzJb6Es/QoIazBUnAXZCgeQq082/eGjLlT\r\n7m4yZ+xM9ULNkAoQwLb8FM6tpqZ/actX3BKU++tjMVTpyUHUlQypyKJKlizH\r\nrG9FddQ7WWmhFpUz+K+XuOXF+G0lLKtXIs2TfXN2MDWKvhMJ1Yn6fALx4Tn8\r\nwyytUWcVg5x0Fqm2XvsXUvUhPF55PdZZXhVBpWz8K60OO/lKxwwpwNBdGbia\r\nJbQshHWIcsphxo3mLDgRzR33Hpv6mQodlYcIxnLm4W7YVTyp87q4SmZ2UAU+\r\ngIRpUwyEfddYwKGx83bmlgSA8VE7yBUUWzVb2891NSv0A2gV9nWR29arV15/\r\nEcYs11Zpkfx8fcgbWN/IR+XMT70TU+17sK3N25DkILSpXyArs8nMFJLqBNWL\r\nrPcz+wSSVRsSnOAqAX5HuOplEzTvMl8n95A=\r\n=zvRu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ceissen","email":"postmaster@papayecube.com"},"directories":{},"maintainers":[{"name":"ceissen","email":"postmaster@papayecube.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mf-maestro-tester_0.0.12_1659093921387_0.1349877194027509"},"_hasShrinkwrap":false}},"time":{"created":"2021-08-23T12:27:22.656Z","0.0.11":"2021-08-23T12:27:22.877Z","modified":"2022-07-29T11:25:21.721Z","0.0.12":"2022-07-29T11:25:21.601Z"},"maintainers":[{"name":"ceissen","email":"postmaster@papayecube.com"}],"description":"a tool to test and develop MfMaestro compatible microfrontends","homepage":"https://github.com/alotela/mf-maestro-tester#readme","keywords":["microservices","microfrontends"],"repository":{"type":"git","url":"git+https://github.com/alotela/mf-maestro-tester.git"},"author":{"name":"Charlie Eissen"},"bugs":{"url":"https://github.com/alotela/mf-maestro-tester/issues"},"license":"ISC","readme":"# MfMaestro tester\n\nA tool to develop MfMaestro compatible microfrontends without MfMaestro.  \nIt simulates a store and events so that you can use all MfMaestro features when developing your MF in an isolated page.  \nJust register your app as you would do (```window.MfMaestro.registerMicroApp(\"micro-app\", {start, stop}```).\nIn your html page's header, add the script node to load it:  \n```<script src=\"https://unpkg.com/mf-maestro-tester@0.0.7/dist/index.js\">```  \nand put an id equal to the registered name (\"micro-app\") on the div where you want to start your application:  \n```<div id=\"micro-app\"></div>``` \n\nIf you want to emit events listened by your MF, open the console and type:  \n```\nwindow.MfMaestro.events.emit(\"your event name\", yourparams...)\n``` \nYou can also add callbacks to listen some events with the ```on``` method:  \n```window.MfMaestro.events.on(\"your event name\", callback)```  \n\nWhen your Mf is started by MfMaestro, the start function receives params and options.\nIf you want to inject params into your MF (url params), you can add a \"params\" argument to your page's query string, with a json5 payload:\n```http://localhost:3000/index.html?params={id:12,sub-id:12344}```\n\nYou can also add queryParams available in ```options``` using the ```query``` argument :\n```http://localhost:3000/index.html?query={order:asc,page:2}```  \n\nYou can use both at the same time to inject in params and options as MfMaestro would do.\n\nIf you need to inject params and want it to be always activated, you can add a script node before loading the tester in your page:\n```\n<script>\nMfMaestroAppParams={a:1, b: 2};\n</script>\n```  \n\nThis will be merged with ```params``` from query string.  \n\n## events queue for tests\n\nAll emitted events are logged in a queue available on ```window.MfMaestro.outputEventsQueue```. An event is logged as a tuple ```[event, args]``` (string, array).  \nIf you want to test for an event, you can use ```window.MfMaestro.eventHasBeenEmitted(event, args, options)```.  \nArgs is an array with all args you passed to emit, AFTER the event name. Since it is optional, if you don't specify it, and call ```window.MfMaestro.eventHasBeenEmitted(event)```, it will be equal to an empty array.  \nOptions is optional and accepts these attributes:  \n\n- **count** : the number of times you expect the event has been emitted  \n\nYou can have a look at the ```tests/test.js``` to find examples.  \n\n## navigation\n\nyou can test for navigations block/unblock with these methods:\n\n- ```window.MfMaestro.isNavigationBlocked(\"myContext\")```\n- ```window.MfMaestro.isNavigationUnblocked(\"myContext\")```\n\nWhen you call ```options.navigation.blockNavigation()``` or ```options.navigation.unblockNavigation()```, just pass a context as arg. It will do nothing in MfMaestro, but will allow to test that navigation block/unblock have been called.  ","readmeFilename":"README.md"}