Skip to content
Permalink
Browse files

refactor: test for side effects, and remove existing ones (#4769) (#4953

)

* test: add test for side-effects

* refactor: remove toplevel property access
  • Loading branch information...
filipesilva authored and benlesh committed Aug 7, 2019
1 parent b6eea10 commit 9829c5e0f97be5ace18e4e41d4b2ccd8968547ae
Showing with 782 additions and 302 deletions.
  1. +1 −0 .circleci/config.yml
  2. +1 −0 .eslintignore
  3. +4 −0 .gitignore
  4. +9 −0 integration/side-effects/README.md
  5. +52 −0 integration/side-effects/side-effects.json
  6. +1 −0 integration/side-effects/snapshots/esm2015/ajax.js
  7. +1 −0 integration/side-effects/snapshots/esm2015/fetch.js
  8. +7 −0 integration/side-effects/snapshots/esm2015/index.js
  9. +7 −0 integration/side-effects/snapshots/esm2015/operators.js
  10. +7 −0 integration/side-effects/snapshots/esm2015/testing.js
  11. +7 −0 integration/side-effects/snapshots/esm2015/websocket.js
  12. +1 −0 integration/side-effects/snapshots/esm5/ajax.js
  13. +1 −0 integration/side-effects/snapshots/esm5/fetch.js
  14. +1 −0 integration/side-effects/snapshots/esm5/index.js
  15. +1 −0 integration/side-effects/snapshots/esm5/operators.js
  16. +1 −0 integration/side-effects/snapshots/esm5/testing.js
  17. +1 −0 integration/side-effects/snapshots/esm5/websocket.js
  18. +570 −230 package-lock.json
  19. +4 −0 package.json
  20. +14 −13 src/internal/observable/ConnectableObservable.ts
  21. +15 −13 src/internal/observable/dom/AjaxObservable.ts
  22. +1 −1 src/internal/observable/dom/ajax.ts
  23. +1 −1 src/internal/observable/fromEvent.ts
  24. +1 −1 src/internal/symbol/observable.ts
  25. +2 −2 src/internal/symbol/rxSubscriber.ts
  26. +11 −7 src/internal/util/ArgumentOutOfRangeError.ts
  27. +11 −7 src/internal/util/EmptyError.ts
  28. +11 −7 src/internal/util/ObjectUnsubscribedError.ts
  29. +11 −7 src/internal/util/TimeoutError.ts
  30. +13 −9 src/internal/util/UnsubscriptionError.ts
  31. +1 −1 src/internal/util/isArray.ts
  32. +13 −3 tslint.json
@@ -50,6 +50,7 @@ jobs:
steps:
- attach_workspace: *attach_options
- run: npm test
- run: npm run test:side-effects

dtslint:
<<: *defaults
@@ -0,0 +1 @@
integration/side-effects/snapshots/
@@ -24,3 +24,7 @@ spec-build/
# Misc
npm-debug.log
.DS_STORE

# The check-side-effects package generates and deletes this file.
# If the process is killed, it will be left behind.
check-side-effects.tmp-input.js
@@ -0,0 +1,9 @@
This test checks if the side effects for loading RxJs packages have changed using <https://github.com/filipesilva/check-side-effects>.

Running `npm test:side-effects` will check all ES modules listed in `side-effects.json`.

Running `npm test:side-effects:update` will update any changed side effects.

To add a new ES module to this test, add a new entry in `side-effects.json`.

Usually the ESM and FESM should have the same output, but retained objects that were renamed during the flattening step will leave behind a different name.
@@ -0,0 +1,52 @@
{
"tests": [
{
"esModules": "../../dist/esm5/index.js",
"expectedOutput": "./snapshots/esm5/index.js"
},
{
"esModules": "../../dist/esm2015/index.js",
"expectedOutput": "./snapshots/esm2015/index.js"
},
{
"esModules": "../../dist/esm5/ajax/index.js",
"expectedOutput": "./snapshots/esm5/ajax.js"
},
{
"esModules": "../../dist/esm2015/ajax/index.js",
"expectedOutput": "./snapshots/esm2015/ajax.js"
},
{
"esModules": "../../dist/esm5/fetch/index.js",
"expectedOutput": "./snapshots/esm5/fetch.js"
},
{
"esModules": "../../dist/esm2015/fetch/index.js",
"expectedOutput": "./snapshots/esm2015/fetch.js"
},
{
"esModules": "../../dist/esm5/operators/index.js",
"expectedOutput": "./snapshots/esm5/operators.js"
},
{
"esModules": "../../dist/esm2015/operators/index.js",
"expectedOutput": "./snapshots/esm2015/operators.js"
},
{
"esModules": "../../dist/esm5/testing/index.js",
"expectedOutput": "./snapshots/esm5/testing.js"
},
{
"esModules": "../../dist/esm2015/testing/index.js",
"expectedOutput": "./snapshots/esm2015/testing.js"
},
{
"esModules": "../../dist/esm5/webSocket/index.js",
"expectedOutput": "./snapshots/esm5/websocket.js"
},
{
"esModules": "../../dist/esm2015/webSocket/index.js",
"expectedOutput": "./snapshots/esm2015/websocket.js"
}
]
}
@@ -0,0 +1 @@

@@ -0,0 +1 @@

@@ -0,0 +1,7 @@
var NotificationKind;

(function(NotificationKind) {
NotificationKind["NEXT"] = "N";
NotificationKind["ERROR"] = "E";
NotificationKind["COMPLETE"] = "C";
})(NotificationKind || (NotificationKind = {}));
@@ -0,0 +1,7 @@
var NotificationKind;

(function(NotificationKind) {
NotificationKind["NEXT"] = "N";
NotificationKind["ERROR"] = "E";
NotificationKind["COMPLETE"] = "C";
})(NotificationKind || (NotificationKind = {}));
@@ -0,0 +1,7 @@
var NotificationKind;

(function(NotificationKind) {
NotificationKind["NEXT"] = "N";
NotificationKind["ERROR"] = "E";
NotificationKind["COMPLETE"] = "C";
})(NotificationKind || (NotificationKind = {}));
@@ -0,0 +1,7 @@
var NotificationKind;

(function(NotificationKind) {
NotificationKind["NEXT"] = "N";
NotificationKind["ERROR"] = "E";
NotificationKind["COMPLETE"] = "C";
})(NotificationKind || (NotificationKind = {}));
@@ -0,0 +1 @@
import "tslib";
@@ -0,0 +1 @@
import "tslib";
@@ -0,0 +1 @@
import "tslib";
@@ -0,0 +1 @@
import "tslib";
@@ -0,0 +1 @@
import "tslib";
@@ -0,0 +1 @@
import "tslib";

0 comments on commit 9829c5e

Please sign in to comment.
You can’t perform that action at this time.