Skip to content

Commit

Permalink
test: add test for side-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed May 10, 2019
1 parent b623af6 commit 27beffc
Show file tree
Hide file tree
Showing 19 changed files with 3,148 additions and 217 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
steps:
- attach_workspace: *attach_options
- run: npm test
- run: npm run test:side-effects

dtslint:
<<: *defaults
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
integration/side-effects/snapshots/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions integration/side-effects/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This test checks if the side effects for loading Angular 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.
52 changes: 52 additions & 0 deletions integration/side-effects/side-effects.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
1 change: 1 addition & 0 deletions integration/side-effects/snapshots/esm2015/ajax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions integration/side-effects/snapshots/esm2015/fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 27beffc

Please sign in to comment.