fix(zone.js): fix 2 bluebird test cases for each/mapSeries (#36295)
`Bluebird.each` and `Bluebird.mapSeries` will accept a callback with `value` parameter, the `value` should be the item in the array, not array itself. For example: ``` const arr = [1, 2]; Bluebird.each(arr, function(value, idx) { console.log(`value: ${value}, idx: ${idx}`); }) ``` the output will be ``` value: 1, idx: 0 value: 2, idx: 1 ``` This PR fix the test cases for `each` and `mapSeries` APIs. PR Close #36295
This commit is contained in:
parent
c5df9ce474
commit
b44f7b5e16
|
@ -283,8 +283,8 @@ describe('bluebird promise', () => {
|
|||
BluebirdPromise
|
||||
.each(
|
||||
BluebirdPromise.map(arr, (item: number) => BluebirdPromise.resolve(item)),
|
||||
(r: number[], idx: number) => {
|
||||
expect(r[idx] === arr[idx]);
|
||||
(r: number, idx: number) => {
|
||||
expect(r).toBe(arr[idx]);
|
||||
expect(Zone.current.name).toEqual('bluebird');
|
||||
})
|
||||
.then((r: any) => {
|
||||
|
@ -304,8 +304,8 @@ describe('bluebird promise', () => {
|
|||
BluebirdPromise
|
||||
.mapSeries(
|
||||
BluebirdPromise.map(arr, (item: number) => BluebirdPromise.resolve(item)),
|
||||
(r: number[], idx: number) => {
|
||||
expect(r[idx] === arr[idx]);
|
||||
(r: number, idx: number) => {
|
||||
expect(r).toBe(arr[idx]);
|
||||
expect(Zone.current.name).toEqual('bluebird');
|
||||
})
|
||||
.then((r: any) => {
|
||||
|
|
Loading…
Reference in New Issue