From c069f86c301deda772ba476fef413a585576580b Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Fri, 29 Sep 2017 09:25:37 -0700 Subject: [PATCH 1/4] feat(index): export types for functions --- package-lock.json | 120 +++++++++++++++++++-------------------- src/RxSandbox.ts | 36 ++++++++++++ src/RxSandboxInstance.ts | 59 +++++++++++++++++++ src/index.ts | 84 +++++---------------------- 4 files changed, 168 insertions(+), 131 deletions(-) create mode 100644 src/RxSandbox.ts create mode 100644 src/RxSandboxInstance.ts diff --git a/package-lock.json b/package-lock.json index fa8e081..0c9aef8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "rx-sandbox", - "version": "0.0.5", + "version": "0.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { "@commitlint/cli": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-3.2.0.tgz", - "integrity": "sha512-vqedqIEih0DUMz7myT+Fw4SLB03hF2U90dSHDBTPtiI3yHsm/yz2ruchRs2RuOTtwtcLrgtTdbFvRWzNkArBWw==", + "integrity": "sha1-vokC8vqFn5Npek4gQwXWtHZICTE=", "dev": true, "requires": { "@commitlint/core": "3.2.0", @@ -27,7 +27,7 @@ "@commitlint/core": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@commitlint/core/-/core-3.2.0.tgz", - "integrity": "sha512-VnBRqhcB+zaFhNpNuMAMtanDUICVKR4t2pJBgB+1VjuHtSJIj6TBrUYs/FHpI65RDwvfpjNM/OPFa0FyqzN8PA==", + "integrity": "sha1-MXU+dy0JS3LKmKXwWP5WFeVMeac=", "dev": true, "requires": { "babel-runtime": "6.26.0", @@ -50,7 +50,7 @@ "@types/chai": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.4.tgz", - "integrity": "sha512-cvU0HomQ7/aGDQJZsbtJXqBQ7w4J4TqLB0Z/h8mKrpRjfeZEvTbygkfJEb7fWdmwpIeDeFmIVwAEqS0OYuUv3Q==", + "integrity": "sha1-/oYxXZpmgn/usW9zvJVGiOyVDhg=", "dev": true }, "@types/jest": { @@ -153,7 +153,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "dev": true, "requires": { "micromatch": "2.3.11", @@ -195,7 +195,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" }, "array-equal": { "version": "1.0.0", @@ -555,7 +555,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", "dev": true }, "balanced-match": { @@ -716,7 +716,7 @@ "ci-info": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.1.tgz", - "integrity": "sha512-vHDDF/bP9RYpTWtUhpJRhCFdvvp3iDWvEbuDbWgvjUrNGV1MXJrE0MPcwGtEled04m61iwdBLUIHZtDgzWS4ZQ==", + "integrity": "sha1-R7RN8RjEjSWXtW00Ln4leRBgFxo=", "dev": true }, "cli-cursor": { @@ -814,7 +814,7 @@ "commander": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "integrity": "sha1-FXFS/R56bI2YpbcVzzdt+SgARWM=", "dev": true }, "commitizen": { @@ -932,7 +932,7 @@ "conventional-changelog": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.5.tgz", - "integrity": "sha512-DUM0iXhgE11uRCoEQnFuYQA5zJcxfvKn940ZFyXziFl0y05yBCoy5ci2fcQYFWQ+OyyxgE2H02EdgYpuz9XG4w==", + "integrity": "sha1-TEb7ZLKYbKsZiI2MS4fKfA5DG/0=", "dev": true, "requires": { "conventional-changelog-angular": "1.5.0", @@ -950,7 +950,7 @@ "conventional-changelog-angular": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.5.0.tgz", - "integrity": "sha512-Gt0qSf5wdFmLabgdSlqjguDAmPyYTXtUl4WH5W3SlpElHhnU/UiCY3M7xcIkZxrNQfVA1UxUBgu65eBbaJnZVA==", + "integrity": "sha1-ULLUUAhEhFX99n4G6gGXL70IGCo=", "dev": true, "requires": { "compare-func": "1.3.2", @@ -960,7 +960,7 @@ "conventional-changelog-atom": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.1.1.tgz", - "integrity": "sha512-6Nlu/+MiD4gi7k3Z+N1vMJWpaPSdvFPWzPGnH4OXewHAxiAl0L/TT9CGgA01fosPxmYr4hMNtD7kyN0tkg8vIA==", + "integrity": "sha1-1AqbKXlhtTx0Xl0XGP0aM3n2qS8=", "dev": true, "requires": { "q": "1.5.0" @@ -969,7 +969,7 @@ "conventional-changelog-cli": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/conventional-changelog-cli/-/conventional-changelog-cli-1.3.3.tgz", - "integrity": "sha512-2bsDXAidc7TWErFHl58IDPPkcHvtscDr6a63tpne7OZPu5JAqeDc3iKimvzvhdUfcWLowlXmoei8sBHMQ0sMYw==", + "integrity": "sha1-yjjyKaJ+wUA2AhsXhqSPW41I1/8=", "dev": true, "requires": { "add-stream": "1.0.0", @@ -982,7 +982,7 @@ "conventional-changelog-codemirror": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.0.tgz", - "integrity": "sha512-jUbY98JoKdAOR5k3pOBiKZ+Iz9t2F84hL7x4WjSRW6x7FdeCEUOjyfml+YClE2h/h62Tf3mwur5jSO8upxxc1g==", + "integrity": "sha1-PMkllV87FEAoJ7FRaASYIZctlFk=", "dev": true, "requires": { "q": "1.5.0" @@ -991,7 +991,7 @@ "conventional-changelog-core": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-1.9.1.tgz", - "integrity": "sha512-Fo0bSeO+NsO6GtuQXts0xQeRpLrxaABTPU8NK4Zij9sJB3zFkU4BObSefJS4F4+EkKujaKCWtfS6Uih+9NpXrQ==", + "integrity": "sha1-3fdnxAWFDfyN8xcmyA+hpqEL3Hs=", "dev": true, "requires": { "conventional-changelog-writer": "2.0.1", @@ -1012,7 +1012,7 @@ "conventional-commits-parser": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz", - "integrity": "sha512-8od6g684Fhi5Vpp4ABRv/RBsW1AY6wSHbJHEK6FGTv+8jvAAnlABniZu/FVmX9TcirkHepaEsa1QGkRvbg0CKw==", + "integrity": "sha1-cdAZEMsKma6yDBROUPgfTfMXhEc=", "dev": true, "requires": { "JSONStream": "1.3.1", @@ -1029,7 +1029,7 @@ "conventional-changelog-ember": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.2.7.tgz", - "integrity": "sha512-Xj1v9uVcKM8N798hMr7e6yiw8IFyvI6Ik+TdjdmG54uGupqvEEWW37xAbPPbdKvgoitbyZkqUTancj055actEg==", + "integrity": "sha1-xq/zWXYoTnIiZJ+BxivZb/Mhe9I=", "dev": true, "requires": { "q": "1.5.0" @@ -1038,7 +1038,7 @@ "conventional-changelog-eslint": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.0.tgz", - "integrity": "sha512-WGKnC0bGPD6BHGiRBfYqNGfy6DZDn2jGs1yxPRT8I2796wYdGqsbDF4477o4fdsxUJvckoW2OFPqkmRMQaCHSA==", + "integrity": "sha1-tLm13AlBeETYfHvPsWvcxobEscE=", "dev": true, "requires": { "q": "1.5.0" @@ -1047,7 +1047,7 @@ "conventional-changelog-express": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.2.0.tgz", - "integrity": "sha512-ujSEmbWfozC1iIjH5Pl7AKtREowvAl10whs1q6c7nZLnoNZK5CmdB2PQ/V42O6rCgUzaLX+ACRW2+g0A/Htqvw==", + "integrity": "sha1-jWZq1BsQ6/lkpGAgYt3S4A3rUY0=", "dev": true, "requires": { "q": "1.5.0" @@ -1074,7 +1074,7 @@ "conventional-changelog-jshint": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.0.tgz", - "integrity": "sha512-uUP4c0et6F2teapl+YY2JHFAHD401U5CkgI+P8PyU0y1zS8BdBy6EnhqgZEXhFOp9fPzUdic+Wv/9alOqw3agQ==", + "integrity": "sha1-Y6167GbNGuVZuv6ANIxGV6brGHI=", "dev": true, "requires": { "compare-func": "1.3.2", @@ -1084,7 +1084,7 @@ "conventional-changelog-writer": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-2.0.1.tgz", - "integrity": "sha512-X4qC758celQOKw0iUPAsH5sJX6fH6N5dboFc3elXb1/SIKhsYMukhhaxWmxRdtVUSqGt9rZg8giwBQG5B2GeKg==", + "integrity": "sha1-R8END6ulJreNGUOJ0ekx0J7mI3I=", "dev": true, "requires": { "compare-func": "1.3.2", @@ -1363,7 +1363,7 @@ "diff": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + "integrity": "sha1-qoVnpu7QPFMfyJ0/cRzQ5SWd7HU=" }, "dot-prop": { "version": "3.0.0", @@ -1417,7 +1417,7 @@ "es-abstract": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.8.2.tgz", - "integrity": "sha512-dvhwFL3yjQxNNsOWx6exMlaDrRHCRGMQlnx5lsXDCZ/J7G/frgIIl94zhZSp/galVAYp7VzPi1OrAHta89/yGQ==", + "integrity": "sha1-JRAyY9xN7L2mDgxzfKMjE1GAJ+4=", "dev": true, "requires": { "es-to-primitive": "1.1.1", @@ -1480,7 +1480,7 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "estraverse": { @@ -1848,7 +1848,7 @@ "fsevents": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "integrity": "sha1-MoK3E/s62A7eDp/PRhG1qm/AM/Q=", "dev": true, "optional": true, "requires": { @@ -2747,7 +2747,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "get-caller-file": { @@ -2828,7 +2828,7 @@ "git-semver-tags": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.2.1.tgz", - "integrity": "sha512-fFyxtzTHCTQKwB4clA2AInVrlflBbVbbJD4NWwmxKXHUgsU/K9kmHNlkPLqFiuy9xu9q3lNopghR4VXeQwZbTQ==", + "integrity": "sha1-bM0qUuc1tzZ0jcdiRE/NlYjidJA=", "dev": true, "requires": { "meow": "3.7.0", @@ -2930,7 +2930,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", "dev": true }, "graceful-fs": { @@ -3042,7 +3042,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=", "dev": true }, "html-encoding-sniffer": { @@ -3068,7 +3068,7 @@ "husky": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz", - "integrity": "sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA==", + "integrity": "sha1-xp7XTi0neXaaF7qDmbVM4LY8EsM=", "dev": true, "requires": { "is-ci": "1.0.10", @@ -3441,7 +3441,7 @@ "async": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz", - "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==", + "integrity": "sha1-hDGQ/WtzV6C54clW7d3V7IRitU0=", "dev": true, "requires": { "lodash": "4.17.4" @@ -3452,13 +3452,13 @@ "istanbul-lib-coverage": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", - "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "integrity": "sha1-c7+5mIhSmUFck9OKPprfeEp3qdo=", "dev": true }, "istanbul-lib-hook": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz", - "integrity": "sha512-3U2HB9y1ZV9UmFlE12Fx+nPtFqIymzrqCksrXujm3NVbAZIJg/RfYgO1XiIa0mbmxTjWpVEVlkIZJ25xVIAfkQ==", + "integrity": "sha1-3WYH8DB2V4/n1vKmMM8UO0m6zdw=", "dev": true, "requires": { "append-transform": "0.4.0" @@ -3482,7 +3482,7 @@ "istanbul-lib-report": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", - "integrity": "sha512-tvF+YmCmH4thnez6JFX06ujIA19WPa9YUiwjc1uALF2cv5dmE3It8b5I8Ob7FHJ70H9Y5yF+TDkVa/mcADuw1Q==", + "integrity": "sha1-8OVfVmVf+jQiIIC3oM1HYOFAX8k=", "dev": true, "requires": { "istanbul-lib-coverage": "1.1.1", @@ -3511,7 +3511,7 @@ "istanbul-lib-source-maps": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz", - "integrity": "sha512-mukVvSXCn9JQvdJl8wP/iPhqig0MRtuWuD4ZNKo6vB2Ik//AmhAKe3QnPN02dmkRe3lTudFk3rzoHhwU4hb94w==", + "integrity": "sha1-pv4ay6jOCO68Y45XLilNJnAIqgw=", "dev": true, "requires": { "debug": "2.6.9", @@ -4855,7 +4855,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -5016,7 +5016,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "1.1.8" @@ -5114,7 +5114,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", "dev": true, "requires": { "hosted-git-info": "2.5.0", @@ -5143,7 +5143,7 @@ "npm-run-all": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.1.tgz", - "integrity": "sha512-qrmqqaJa+REbzUTIL/mHfTdgwz+gL1xUezY/ueyLa7GISZ4T3h0CH8D2r6AaZdCYN2unu7PzspP0ofpXla1ftg==", + "integrity": "sha1-MJXPPzys9X/LZishCrEMYJr23bs=", "dev": true, "requires": { "ansi-styles": "3.2.0", @@ -7040,7 +7040,7 @@ "p-cancelable": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", - "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==", + "integrity": "sha1-ueEjgAvOu3rBOkeb4ZW1B7mNMPo=", "dev": true }, "p-finally": { @@ -7304,7 +7304,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", "requires": { "is-number": "3.0.0", "kind-of": "4.0.0" @@ -7395,7 +7395,7 @@ "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "integrity": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=", "dev": true, "requires": { "core-util-is": "1.0.2", @@ -7429,13 +7429,13 @@ "regenerator-runtime": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "integrity": "sha1-flT+W1zNXWYk6mJVw0c74JC4AuE=", "dev": true }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", "requires": { "is-equal-shallow": "0.1.3" } @@ -7523,7 +7523,7 @@ "resolve": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "integrity": "sha1-p1vgHFPaJdk0qY69DkxKcxL5KoY=", "dev": true, "requires": { "path-parse": "1.0.5" @@ -7598,7 +7598,7 @@ "rxjs": { "version": "5.4.3", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz", - "integrity": "sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==", + "integrity": "sha1-B1jN3uYDPWjg/VNnbw81ls49SD8=", "dev": true, "requires": { "symbol-observable": "1.0.4" @@ -7607,7 +7607,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", "dev": true }, "sane": { @@ -7629,13 +7629,13 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", "dev": true }, "semver": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=", "dev": true }, "set-blocking": { @@ -7685,7 +7685,7 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", "dev": true }, "shx": { @@ -7785,7 +7785,7 @@ "split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", + "integrity": "sha1-YFvZvjA6pZ+zX5Ip++oN3snqB9k=", "dev": true, "requires": { "through": "2.3.8" @@ -7889,7 +7889,7 @@ "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -7998,7 +7998,7 @@ "test-exclude": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.1.1.tgz", - "integrity": "sha512-35+Asrsk3XHJDBgf/VRFexPgh3UyETv8IAn/LRTiZjVy6rjPVqdEk8dJcJYBzl1w0XCJM48lvTy8SfEsCWS4nA==", + "integrity": "sha1-TYSWSwlmsAh+zDNKLOAC09k0HiY=", "dev": true, "requires": { "arrify": "1.0.1", @@ -8011,7 +8011,7 @@ "text-extensions": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.6.0.tgz", - "integrity": "sha512-U2M04F2rbuYYCNioiTD14cImLTae4ys1rC57tllzKg3dt5DPR2JXs5yFdC017yOBrW6wM6s5gtAlFJ7yye04rA==", + "integrity": "sha1-dxVhsmAieDpF9bbC54rW596f4yI=", "dev": true }, "thenify": { @@ -8458,7 +8458,7 @@ "v8flags": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.0.tgz", - "integrity": "sha512-AGl+C+4qpeSu2g3JxCD/mGFFOs/vVZ3XREkD3ibQXEqr4Y4zgIrPWW124/IKJFHOIVFIoH8miWrLf0o84HYjwA==", + "integrity": "sha1-S+lgRIjgxBI2Rd73BbGEjRa44B8=", "dev": true, "requires": { "user-home": "1.1.1" @@ -8503,7 +8503,7 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", "dev": true }, "whatwg-encoding": { @@ -8536,7 +8536,7 @@ "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", "dev": true, "requires": { "isexe": "2.0.0" @@ -8558,7 +8558,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", "dev": true }, "wordwrap": { @@ -8570,7 +8570,7 @@ "worker-farm": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.5.0.tgz", - "integrity": "sha512-DHRiUggxtbruaTwnLDm2/BRDKZIoOYvrgYUj5Bam4fU6Gtvc0FaEyoswFPBjMXAweGW2H4BDNIpy//1yXXuaqQ==", + "integrity": "sha1-rf3wzUBYFGXtCh9kj5c1cir9XI0=", "dev": true, "requires": { "errno": "0.1.4", @@ -8596,7 +8596,7 @@ "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "integrity": "sha1-H/YVdcLipOjlENb6TiQ8zhg5mas=", "dev": true, "requires": { "graceful-fs": "4.1.11", diff --git a/src/RxSandbox.ts b/src/RxSandbox.ts new file mode 100644 index 0000000..abc7556 --- /dev/null +++ b/src/RxSandbox.ts @@ -0,0 +1,36 @@ +import { SubscriptionLog } from 'rxjs/testing/SubscriptionLog'; +import { TestMessage } from './message/TestMessage'; +import { RxSandboxInstance } from './RxSandboxInstance'; + +export interface RxSandbox { + /** + * Creates new instance of test scheduler for testing observables. + * + * @param {boolean} [autoFlush] Flush scheduler automatically when `getMarbles` is being called. False by default. + * @param {number} [frameTimeFactor] Custom frametime factor for virtual time frame. 1 by default. + * @param {number} [maxFrameValue] Maximum frame value of marble diagram can be read. + * If marble has value over max frame, it'll be ignored when scheduler flushes out. + * 1000 * frameTimeFactory by default. + * @return {RxSandboxInstance} instance of test scheduler interfaces. + */ + create(autoFlush?: boolean, frameTimeFactor?: number, maxFrameValue?: number): RxSandboxInstance; + /** + * Utility assertion method to assert marble based observable test messages. + * By default return values of sandbox functions are plain object works with + * any testing framework or assertion library, while this assertion provides + * better visualization against observable test messages. + * + */ + marbleAssert( + source: Array>>> | Readonly>>>> + ): { + to: { + equal( + expected: + | Array>>> + | Readonly>>>> + ): void; + }; + }; + marbleAssert(source: Array): { to: { equal(expected: Array): void } }; +} diff --git a/src/RxSandboxInstance.ts b/src/RxSandboxInstance.ts new file mode 100644 index 0000000..13f2ac3 --- /dev/null +++ b/src/RxSandboxInstance.ts @@ -0,0 +1,59 @@ +import { SubscriptionLog } from 'rxjs/testing/SubscriptionLog'; +import { TestMessage } from './message/TestMessage'; +import { TestScheduler } from './scheduler/TestScheduler'; + +type hotObservable = typeof TestScheduler.prototype.createHotObservable; +type coldObservable = typeof TestScheduler.prototype.createColdObservable; +type flushScheduler = typeof TestScheduler.prototype.flush; +type advanceToScheduler = typeof TestScheduler.prototype.advanceTo; +type getObservableMessage = typeof TestScheduler.prototype.getMessages; +type expectedObservable = ( + marble: string, + value?: { [key: string]: T } | null, + error?: any +) => Readonly>>>>; +type expectedSubscription = (marble: string) => SubscriptionLog; + +type RxSandboxInstance = { + /** + * Creates a hot observable using marble diagram DSL, or TestMessage. + */ + hot: hotObservable; + /** + * Creates a cold obsrevable using marbld diagram DSL, or TestMessage. + */ + cold: coldObservable; + /** + * Flush out currently scheduled observables, fill values returned by `getMarbles`. + */ + flush: flushScheduler; + /** + * Flush out currently scheduled observables, only until reaches frame specfied. + */ + advanceTo: advanceToScheduler; + /** + * Get array of observable value's metadata TestMessage from observable + * created via `hot` or `cold`. Returned array will be filled once scheduler flushes + * scheduled actions, either via explicit `flush` or implicit `autoFlush`. + */ + getMessages: getObservableMessage; + /** + * Utility function to generate `expected` values via marble diagram. + */ + e: expectedObservable; + /** + * Utility function to generate `expected` subscriptions via marble diagram. + */ + s: expectedSubscription; +}; + +export { + hotObservable, + coldObservable, + flushScheduler, + advanceToScheduler, + getObservableMessage, + expectedObservable, + expectedSubscription, + RxSandboxInstance +}; diff --git a/src/index.ts b/src/index.ts index dd8e6d5..be7856f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,88 +1,30 @@ import { Observable } from 'rxjs/Observable'; import { ColdObservable } from 'rxjs/testing/ColdObservable'; import { HotObservable } from 'rxjs/testing/HotObservable'; -import { SubscriptionLog } from 'rxjs/testing/SubscriptionLog'; import { marbleAssert } from './assert/marbleAssert'; import { parseObservableMarble } from './marbles/parseObservableMarble'; import { parseSubscriptionMarble } from './marbles/parseSubscriptionMarble'; import { TestMessage } from './message/TestMessage'; import { complete, error, next, subscribe } from './message/TestMessage'; +import { RxSandbox } from './RxSandbox'; import { TestScheduler } from './scheduler/TestScheduler'; +export { + hotObservable, + coldObservable, + flushScheduler, + advanceToScheduler, + getObservableMessage, + expectedObservable, + expectedSubscription, + RxSandboxInstance +} from './RxSandboxInstance'; //workaround TS4029 by explicitly import types and avoid unused import error (() => Observable.toString())(); (() => ColdObservable.toString())(); (() => HotObservable.toString())(); -export type RxSandboxInstance = { - /** - * Creates a hot observable using marble diagram DSL, or TestMessage. - */ - hot: typeof TestScheduler.prototype.createHotObservable; - /** - * Creates a cold obsrevable using marbld diagram DSL, or TestMessage. - */ - cold: typeof TestScheduler.prototype.createColdObservable; - /** - * Flush out currently scheduled observables, fill values returned by `getMarbles`. - */ - flush: typeof TestScheduler.prototype.flush; - /** - * Flush out currently scheduled observables, only until reaches frame specfied. - */ - advanceTo: typeof TestScheduler.prototype.advanceTo; - /** - * Get array of observable value's metadata TestMessage from observable - * created via `hot` or `cold`. Returned array will be filled once scheduler flushes - * scheduled actions, either via explicit `flush` or implicit `autoFlush`. - */ - getMessages: typeof TestScheduler.prototype.getMessages; - /** - * Utility function to generate `expected` values via marble diagram. - */ - e: ( - marble: string, - value?: { [key: string]: T } | null, - error?: any - ) => Readonly>>>>; - /** - * Utility function to generate `expected` subscriptions via marble diagram. - */ - s: (marble: string) => SubscriptionLog; -}; - -export interface RxSandbox { - /** - * Creates new instance of test scheduler for testing observables. - * - * @param {boolean} [autoFlush] Flush scheduler automatically when `getMarbles` is being called. False by default. - * @param {number} [frameTimeFactor] Custom frametime factor for virtual time frame. 1 by default. - * @param {number} [maxFrameValue] Maximum frame value of marble diagram can be read. - * If marble has value over max frame, it'll be ignored when scheduler flushes out. - * 1000 * frameTimeFactory by default. - * @return {RxSandboxInstance} instance of test scheduler interfaces. - */ - create(autoFlush?: boolean, frameTimeFactor?: number, maxFrameValue?: number): RxSandboxInstance; - /** - * Utility assertion method to assert marble based observable test messages. - * By default return values of sandbox functions are plain object works with - * any testing framework or assertion library, while this assertion provides - * better visualization against observable test messages. - * - */ - marbleAssert( - source: Array>>> | Readonly>>>> - ): { - to: { - equal( - expected: - | Array>>> - | Readonly>>>> - ): void; - }; - }; - marbleAssert(source: Array): { to: { equal(expected: Array): void } }; -} +type marbleAssertion = typeof marbleAssert; const rxSandbox: RxSandbox = { create: (autoFlush: boolean = false, frameTimeFactor: number = 1, maxFrameValue = 1000) => { @@ -102,4 +44,4 @@ const rxSandbox: RxSandbox = { marbleAssert: marbleAssert }; -export { rxSandbox, TestMessage, next, error, complete, subscribe }; +export { rxSandbox, TestMessage, marbleAssertion, next, error, complete, subscribe }; From 6fe61d6681b12d0491b4218a3dc88e70661b4b59 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Fri, 29 Sep 2017 09:26:56 -0700 Subject: [PATCH 2/4] test(jest): exclude interface from coverage --- jest.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jest.json b/jest.json index 08635ef..9a48795 100644 --- a/jest.json +++ b/jest.json @@ -31,6 +31,8 @@ "coveragePathIgnorePatterns": [ "/node_modules/", "/spec/.*\\.(ts|js)$", - "/build/.*\\.(ts|js)$" + "/build/.*\\.(ts|js)$", + "/src/RxSandbox.ts", + "/src/RxSandboxInstance.ts" ] } \ No newline at end of file From 681b74e81ea7b62b8476f83ab05847081ef08534 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Fri, 29 Sep 2017 09:28:39 -0700 Subject: [PATCH 3/4] chore(package): bump up version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 001b9b3..aea6957 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rx-sandbox", - "version": "0.0.6", + "version": "0.0.7", "description": "Marble diagram DSL based test suite for RxJS 5", "main": "./dist/src/index.js", "types": "./dist/src/index.d.ts", From bcd7a3c9d7d1827840d41eded31282f945b8377a Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Fri, 29 Sep 2017 09:29:01 -0700 Subject: [PATCH 4/4] chore(release): release 0.0.7 --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc86b4..5c0851b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ + +## [0.0.7](https://github.com/kwonoj/rx-sandbox/compare/v0.0.6...v0.0.7) (2017-09-29) + + +### Features + +* **index:** export types for functions ([c069f86](https://github.com/kwonoj/rx-sandbox/commit/c069f86)) + + + ## [0.0.6](https://github.com/kwonoj/rx-sandbox/compare/v0.0.5...v0.0.6) (2017-09-26)