11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ciconst { strictEqual } = require('assert'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciasync function test() { 61cb0ef41Sopenharmony_ci { 71cb0ef41Sopenharmony_ci const results = await Promise.allSettled([ 81cb0ef41Sopenharmony_ci import('../fixtures/empty.js', { with: { type: 'json' } }), 91cb0ef41Sopenharmony_ci import('../fixtures/empty.js'), 101cb0ef41Sopenharmony_ci ]); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci strictEqual(results[0].status, 'rejected'); 131cb0ef41Sopenharmony_ci strictEqual(results[1].status, 'fulfilled'); 141cb0ef41Sopenharmony_ci } 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci { 171cb0ef41Sopenharmony_ci const results = await Promise.allSettled([ 181cb0ef41Sopenharmony_ci import('../fixtures/empty.js'), 191cb0ef41Sopenharmony_ci import('../fixtures/empty.js', { with: { type: 'json' } }), 201cb0ef41Sopenharmony_ci ]); 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci strictEqual(results[0].status, 'fulfilled'); 231cb0ef41Sopenharmony_ci strictEqual(results[1].status, 'rejected'); 241cb0ef41Sopenharmony_ci } 251cb0ef41Sopenharmony_ci 261cb0ef41Sopenharmony_ci { 271cb0ef41Sopenharmony_ci const results = await Promise.allSettled([ 281cb0ef41Sopenharmony_ci import('../fixtures/empty.json', { with: { type: 'json' } }), 291cb0ef41Sopenharmony_ci import('../fixtures/empty.json'), 301cb0ef41Sopenharmony_ci ]); 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ci strictEqual(results[0].status, 'fulfilled'); 331cb0ef41Sopenharmony_ci strictEqual(results[1].status, 'rejected'); 341cb0ef41Sopenharmony_ci } 351cb0ef41Sopenharmony_ci 361cb0ef41Sopenharmony_ci { 371cb0ef41Sopenharmony_ci const results = await Promise.allSettled([ 381cb0ef41Sopenharmony_ci import('../fixtures/empty.json'), 391cb0ef41Sopenharmony_ci import('../fixtures/empty.json', { with: { type: 'json' } }), 401cb0ef41Sopenharmony_ci ]); 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ci strictEqual(results[0].status, 'rejected'); 431cb0ef41Sopenharmony_ci strictEqual(results[1].status, 'fulfilled'); 441cb0ef41Sopenharmony_ci } 451cb0ef41Sopenharmony_ci} 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_citest().then(common.mustCall()); 48