diff --git a/.github/workflows/ci_main.yml b/.github/workflows/ci_main.yml index 17cb3d87f8..7b6558e0f0 100644 --- a/.github/workflows/ci_main.yml +++ b/.github/workflows/ci_main.yml @@ -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 diff --git a/package.json b/package.json index 67199e002b..96761c48e5 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/spec/module-test-spec.mjs b/spec/module-test-spec.mjs new file mode 100644 index 0000000000..66a4924696 --- /dev/null +++ b/spec/module-test-spec.mjs @@ -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';