• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2const common = require('../common');
3const assert = require('assert');
4const child_process = require('child_process');
5const fixtures = require('../common/fixtures');
6
7const wrong_script = fixtures.path('keys/rsa_cert.crt');
8
9const p = child_process.spawn(process.execPath, [
10  '-e',
11  'require(process.argv[1]);',
12  wrong_script,
13]);
14
15p.stdout.on('data', common.mustNotCall());
16
17let output = '';
18
19p.stderr.on('data', (data) => output += data);
20
21p.stderr.on('end', common.mustCall(() => {
22  assert.match(output, /BEGIN CERT/);
23  assert.match(output, /^\s+\^/m);
24  assert.match(output, /Invalid left-hand side expression in prefix operation/);
25}));
26