xref: /third_party/node/test/parallel/test-vm-syntax-error-stderr.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst child_process = require('child_process');
51cb0ef41Sopenharmony_ciconst fixtures = require('../common/fixtures');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst wrong_script = fixtures.path('keys/rsa_cert.crt');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ciconst p = child_process.spawn(process.execPath, [
101cb0ef41Sopenharmony_ci  '-e',
111cb0ef41Sopenharmony_ci  'require(process.argv[1]);',
121cb0ef41Sopenharmony_ci  wrong_script,
131cb0ef41Sopenharmony_ci]);
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cip.stdout.on('data', common.mustNotCall());
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_cilet output = '';
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_cip.stderr.on('data', (data) => output += data);
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_cip.stderr.on('end', common.mustCall(() => {
221cb0ef41Sopenharmony_ci  assert.match(output, /BEGIN CERT/);
231cb0ef41Sopenharmony_ci  assert.match(output, /^\s+\^/m);
241cb0ef41Sopenharmony_ci  assert.match(output, /Invalid left-hand side expression in prefix operation/);
251cb0ef41Sopenharmony_ci}));
26

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