11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci(async () => {
61cb0ef41Sopenharmony_ci  await assert.rejects(import('data:text/plain,export default0'), {
71cb0ef41Sopenharmony_ci    code: 'ERR_UNKNOWN_MODULE_FORMAT',
81cb0ef41Sopenharmony_ci    message:
91cb0ef41Sopenharmony_ci      'Unknown module format: text/plain for URL data:text/plain,' +
101cb0ef41Sopenharmony_ci      'export default0',
111cb0ef41Sopenharmony_ci  });
121cb0ef41Sopenharmony_ci  await assert.rejects(import('data:text/plain;base64,'), {
131cb0ef41Sopenharmony_ci    code: 'ERR_UNKNOWN_MODULE_FORMAT',
141cb0ef41Sopenharmony_ci    message:
151cb0ef41Sopenharmony_ci      'Unknown module format: text/plain for URL data:text/plain;base64,',
161cb0ef41Sopenharmony_ci  });
171cb0ef41Sopenharmony_ci  await assert.rejects(import('data:text/css,.error { color: red; }'), {
181cb0ef41Sopenharmony_ci    code: 'ERR_UNKNOWN_MODULE_FORMAT',
191cb0ef41Sopenharmony_ci    message: 'Unknown module format: text/css for URL data:text/css,.error { color: red; }',
201cb0ef41Sopenharmony_ci  });
211cb0ef41Sopenharmony_ci  await assert.rejects(import('data:WRONGtext/javascriptFORMAT,console.log("hello!");'), {
221cb0ef41Sopenharmony_ci    code: 'ERR_UNKNOWN_MODULE_FORMAT',
231cb0ef41Sopenharmony_ci  });
241cb0ef41Sopenharmony_ci})().then(common.mustCall());
25