Skip to content

Commit

Permalink
feat(esm): Add test case for esm imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Mar 30, 2021
1 parent 3c34f42 commit 785e814
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ jobs:
- name: import
if: ${{ matrix.node == '14' }}
run: npm run test:import
- name: import
if: ${{ matrix.node == '14' || matrix.node == '15' }}
run: npm run test:esm

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"prepublishOnly": "npm run build:package && npm run lint && npm run test && npm run test:circular && npm run dtslint && npm run test:side-effects && npm run api_guardian",
"publish_docs": "./publish_docs.sh",
"test": "npm run compile && mocha --config spec/support/.mocharc.js \"dist/spec/**/*-spec.js\"",
"test:esm": "node spec/module-test-spec.mjs",
"test:browser": "echo \"Browser test is not working currently\" && exit -1 && npm-run-all build:spec:browser && opn spec/support/mocha-browser-runner.html",
"test:circular": "dependency-cruiser --validate .dependency-cruiser.json -x \"^node_modules\" dist/esm5",
"test:systemjs": "node integration/systemjs/systemjs-compatibility-spec.js",
Expand Down
13 changes: 13 additions & 0 deletions spec/module-test-spec.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Test file to ensure rxjs can be loaded from esm
https://github.com/ReactiveX/rxjs/pull/6192
If this fails node will error when running this with an error like
node:internal/process/esm_loader:74
internalBinding('errors').triggerUncaughtException(
*/
import {Observable} from 'rxjs';
import * as o from 'rxjs/operators';
import * as a from 'rxjs/ajax';
import * as f from 'rxjs/fetch';
import * as t from 'rxjs/testing';
import * as w from 'rxjs/webSocket';

0 comments on commit 785e814

Please sign in to comment.