/
githubmirror
/
jest
Обзор
Документация
Войти
/
githubmirror
/
jest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
e2e/failures/__tests__/aggregateError.test.js
25 строк
646 B
Koyomi
fix(jest-message-util): print inner errors of AggregateError test failures (#16316)
10 авг 2026, 15:32
Не верифицирован
10 авг 2026, 15:32
a189ce0
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ 'use strict'; function connectToPrimary() { return Promise.reject(new Error('ECONNREFUSED primary')); } function connectToReplica() { return Promise.reject(new Error('ETIMEDOUT replica')); } it('throws an AggregateError', () => { throw new AggregateError([new Error('inner A'), new Error('inner B')]); }); it('rejects with an AggregateError from Promise.any', async () => { await Promise.any([connectToPrimary(), connectToReplica()]); });