xref: /third_party/node/test/es-module/test-esm-cjs-main.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/es-module/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst { spawnPromisified } = require('../common');
41cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures.js');
51cb0ef41Sopenharmony_ciconst assert = require('node:assert');
61cb0ef41Sopenharmony_ciconst { execPath } = require('node:process');
71cb0ef41Sopenharmony_ciconst { describe, it } = require('node:test');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cidescribe('ESM: importing CJS', () => {
111cb0ef41Sopenharmony_ci  it('should work', async () => {
121cb0ef41Sopenharmony_ci    const { code, signal, stdout } = await spawnPromisified(execPath, [
131cb0ef41Sopenharmony_ci      fixtures.path('/es-modules/cjs.js'),
141cb0ef41Sopenharmony_ci    ]);
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci    assert.strictEqual(code, 0);
171cb0ef41Sopenharmony_ci    assert.strictEqual(signal, null);
181cb0ef41Sopenharmony_ci    assert.strictEqual(stdout, 'executed\n');
191cb0ef41Sopenharmony_ci  });
201cb0ef41Sopenharmony_ci});
21

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