11cb0ef41Sopenharmony_ci// Flags: --experimental-loader ./test/fixtures/es-module-loaders/assertionless-json-import.mjs 21cb0ef41Sopenharmony_ci'use strict'; 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { strictEqual } = require('assert'); 51cb0ef41Sopenharmony_ci 61cb0ef41Sopenharmony_ciasync function test() { 71cb0ef41Sopenharmony_ci { 81cb0ef41Sopenharmony_ci const [secret0, secret1] = await Promise.all([ 91cb0ef41Sopenharmony_ci import('../fixtures/experimental.json'), 101cb0ef41Sopenharmony_ci import( 111cb0ef41Sopenharmony_ci '../fixtures/experimental.json', 121cb0ef41Sopenharmony_ci { with: { type: 'json' } } 131cb0ef41Sopenharmony_ci ), 141cb0ef41Sopenharmony_ci ]); 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci strictEqual(secret0.default.ofLife, 42); 171cb0ef41Sopenharmony_ci strictEqual(secret1.default.ofLife, 42); 181cb0ef41Sopenharmony_ci strictEqual(secret0.default, secret1.default); 191cb0ef41Sopenharmony_ci strictEqual(secret0, secret1); 201cb0ef41Sopenharmony_ci } 211cb0ef41Sopenharmony_ci 221cb0ef41Sopenharmony_ci { 231cb0ef41Sopenharmony_ci const [secret0, secret1] = await Promise.all([ 241cb0ef41Sopenharmony_ci import('../fixtures/experimental.json?test'), 251cb0ef41Sopenharmony_ci import( 261cb0ef41Sopenharmony_ci '../fixtures/experimental.json?test', 271cb0ef41Sopenharmony_ci { with: { type: 'json' } } 281cb0ef41Sopenharmony_ci ), 291cb0ef41Sopenharmony_ci ]); 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ci strictEqual(secret0.default.ofLife, 42); 321cb0ef41Sopenharmony_ci strictEqual(secret1.default.ofLife, 42); 331cb0ef41Sopenharmony_ci strictEqual(secret0.default, secret1.default); 341cb0ef41Sopenharmony_ci strictEqual(secret0, secret1); 351cb0ef41Sopenharmony_ci } 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci { 381cb0ef41Sopenharmony_ci const [secret0, secret1] = await Promise.all([ 391cb0ef41Sopenharmony_ci import('../fixtures/experimental.json#test'), 401cb0ef41Sopenharmony_ci import( 411cb0ef41Sopenharmony_ci '../fixtures/experimental.json#test', 421cb0ef41Sopenharmony_ci { with: { type: 'json' } } 431cb0ef41Sopenharmony_ci ), 441cb0ef41Sopenharmony_ci ]); 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci strictEqual(secret0.default.ofLife, 42); 471cb0ef41Sopenharmony_ci strictEqual(secret1.default.ofLife, 42); 481cb0ef41Sopenharmony_ci strictEqual(secret0.default, secret1.default); 491cb0ef41Sopenharmony_ci strictEqual(secret0, secret1); 501cb0ef41Sopenharmony_ci } 511cb0ef41Sopenharmony_ci 521cb0ef41Sopenharmony_ci { 531cb0ef41Sopenharmony_ci const [secret0, secret1] = await Promise.all([ 541cb0ef41Sopenharmony_ci import('../fixtures/experimental.json?test2#test'), 551cb0ef41Sopenharmony_ci import( 561cb0ef41Sopenharmony_ci '../fixtures/experimental.json?test2#test', 571cb0ef41Sopenharmony_ci { with: { type: 'json' } } 581cb0ef41Sopenharmony_ci ), 591cb0ef41Sopenharmony_ci ]); 601cb0ef41Sopenharmony_ci 611cb0ef41Sopenharmony_ci strictEqual(secret0.default.ofLife, 42); 621cb0ef41Sopenharmony_ci strictEqual(secret1.default.ofLife, 42); 631cb0ef41Sopenharmony_ci strictEqual(secret0.default, secret1.default); 641cb0ef41Sopenharmony_ci strictEqual(secret0, secret1); 651cb0ef41Sopenharmony_ci } 661cb0ef41Sopenharmony_ci 671cb0ef41Sopenharmony_ci { 681cb0ef41Sopenharmony_ci const [secret0, secret1] = await Promise.all([ 691cb0ef41Sopenharmony_ci import('data:application/json,{"ofLife":42}'), 701cb0ef41Sopenharmony_ci import( 711cb0ef41Sopenharmony_ci 'data:application/json,{"ofLife":42}', 721cb0ef41Sopenharmony_ci { with: { type: 'json' } } 731cb0ef41Sopenharmony_ci ), 741cb0ef41Sopenharmony_ci ]); 751cb0ef41Sopenharmony_ci 761cb0ef41Sopenharmony_ci strictEqual(secret0.default.ofLife, 42); 771cb0ef41Sopenharmony_ci strictEqual(secret1.default.ofLife, 42); 781cb0ef41Sopenharmony_ci } 791cb0ef41Sopenharmony_ci} 801cb0ef41Sopenharmony_ci 811cb0ef41Sopenharmony_citest().then(common.mustCall()); 82