mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
PR-URL: https://github.com/nodejs/node/pull/41736 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import '../common/index.mjs';
|
|
import { strictEqual } from 'assert';
|
|
|
|
{
|
|
const results = await Promise.allSettled([
|
|
import('../fixtures/empty.js', { assert: { type: 'json' } }),
|
|
import('../fixtures/empty.js'),
|
|
]);
|
|
|
|
strictEqual(results[0].status, 'rejected');
|
|
strictEqual(results[1].status, 'fulfilled');
|
|
}
|
|
|
|
{
|
|
const results = await Promise.allSettled([
|
|
import('../fixtures/empty.js'),
|
|
import('../fixtures/empty.js', { assert: { type: 'json' } }),
|
|
]);
|
|
|
|
strictEqual(results[0].status, 'fulfilled');
|
|
strictEqual(results[1].status, 'rejected');
|
|
}
|
|
|
|
{
|
|
const results = await Promise.allSettled([
|
|
import('../fixtures/empty.json', { assert: { type: 'json' } }),
|
|
import('../fixtures/empty.json'),
|
|
]);
|
|
|
|
strictEqual(results[0].status, 'fulfilled');
|
|
strictEqual(results[1].status, 'rejected');
|
|
}
|
|
|
|
{
|
|
const results = await Promise.allSettled([
|
|
import('../fixtures/empty.json'),
|
|
import('../fixtures/empty.json', { assert: { type: 'json' } }),
|
|
]);
|
|
|
|
strictEqual(results[0].status, 'rejected');
|
|
strictEqual(results[1].status, 'fulfilled');
|
|
}
|