Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 26c83cb

Browse files
committed
change spec to pass test
1 parent 0f78e0e commit 26c83cb

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

lib/rxjs/rxjs.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
declare let define: any;
1010
(function(root: any, factory: (Rx: any) => any) {
11-
if (typeof define === 'function' && define.amd) {
12-
// AMD
13-
define(['Rx'], factory);
14-
} else if (typeof exports === 'object') {
11+
if (typeof exports === 'object' && typeof module !== 'undefined') {
1512
// Node, CommonJS-like
1613
module.exports = factory(require('rxjs'));
14+
} else if (typeof define === 'function' && define.amd) {
15+
// AMD
16+
define(['rxjs'], factory);
1717
} else {
18-
root.returnExports = factory(root.Rx);
18+
factory(root.Rx);
1919
}
2020
}(typeof window !== 'undefined' && window || typeof self !== 'undefined' && self || global,
2121
(Rx: any) => {

test/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ declare const __karma__: {
1515
__karma__.loaded = function() {};
1616
(window as any).global = window;
1717

18-
System.config({defaultJSExtensions: true, map: {'Rx': 'base/node_modules/rxjs/bundles/Rx.js'}});
18+
System.config({defaultJSExtensions: true, map: {'rxjs': 'base/node_modules/rxjs/bundles/Rx.js'}});
1919
let browserPatchedPromise: any = null;
2020
if ((window as any)[(Zone as any).__symbol__('setTimeout')]) {
2121
browserPatchedPromise = Promise.resolve('browserPatched');

test/rxjs/rxjs.spec.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
const rxjs = require('Rx');
9+
let rxjs;
10+
if (typeof exports === 'object') {
11+
rxjs = require('rxjs');
12+
} else {
13+
rxjs = (window as any).Rx;
14+
}
1015
const Observable = rxjs.Observable;
1116
const Subscriber = rxjs.Subscriber;
1217

0 commit comments

Comments
 (0)