-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(node): no more silent failure for many copies of rxjs (#3477)
closes #3475
- Loading branch information
Showing
4 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
rm -rf node-tests/node_modules/ | ||
|
||
mkdir -p node-tests/node_modules/rxjs | ||
mkdir -p node-tests/node_modules/rxjs1 | ||
|
||
cp -R dist/package/. node-tests/node_modules/rxjs | ||
cp -R dist/package/. node-tests/node_modules/rxjs1 | ||
|
||
{ | ||
node node-tests/test.js | ||
# node --inspect-brk node-tests/test.js | ||
} || { | ||
echo 'TEST FAILED' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
var of = require('rxjs/observable/of').of; | ||
var of1 = require('rxjs1/observable/of').of; | ||
var from1 = require('rxjs1/observable/from').from; | ||
var mergeMap = require('rxjs/operators/mergeMap').mergeMap; | ||
var mergeMap1 = require('rxjs1/operators/mergeMap').mergeMap; | ||
|
||
var actual = []; | ||
var expected = [1]; | ||
|
||
var id = setTimeout(function () { | ||
throw new Error('TIMEOUT: Observable did not complete'); | ||
}, 200); | ||
|
||
of1(0).pipe( | ||
mergeMap1(function (x) { return of(x); }), | ||
mergeMap(function () { return from1(Promise.resolve(1)); }) | ||
).subscribe({ | ||
next: function (value) { actual.push(value); }, | ||
error: function (err) { | ||
console.error(err); | ||
throw new Error('should not error'); | ||
}, | ||
complete: function () { | ||
if (actual.length !== expected.length || actual[0] !== expected[0] || actual[1] !== expected[1]) { | ||
throw new Error(actual + ' does not equal ' + expected); | ||
} else { | ||
clearTimeout(id); | ||
console.log('TEST PASSED'); | ||
} | ||
}, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters