xref: /third_party/node/test/es-module/test-esm-repl.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst { spawn } = require('child_process');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst child = spawn(process.execPath, [
71cb0ef41Sopenharmony_ci  '--interactive',
81cb0ef41Sopenharmony_ci]);
91cb0ef41Sopenharmony_cichild.stdin.end(`
101cb0ef41Sopenharmony_ciimport('fs').then(
111cb0ef41Sopenharmony_ci  ns => ns.default === require('fs') ? 0 : 1,
121cb0ef41Sopenharmony_ci  _ => 2
131cb0ef41Sopenharmony_ci).then(process.exit)
141cb0ef41Sopenharmony_ci`);
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_cichild.on('exit', (code) => {
171cb0ef41Sopenharmony_ci  assert.strictEqual(code, 0);
181cb0ef41Sopenharmony_ci});
19

Indexes created Thu Nov 07 10:32:03 CST 2024