• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3const assert = require('assert');
4const os = require('os');
5const cp = require('child_process');
6
7if (process.argv[2] === 'child') {
8  const { internalBinding } = require('internal/test/binding');
9  // This is the heart of the test.
10  new (internalBinding('zlib').Zlib)(0).init(1, 2, 3, 4, 5);
11} else {
12  const child = cp.spawnSync(
13    `${process.execPath}`, ['--expose-internals', `${__filename}`, 'child']);
14
15  assert.strictEqual(child.stdout.toString(), '');
16  assert.ok(child.stderr.includes(
17    'WARNING: You are likely using a version of node-tar or npm that ' +
18    `is incompatible with this version of Node.js.${os.EOL}` +
19    'Please use either the version of npm that is bundled with Node.js, or ' +
20    'a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is ' +
21    `compatible with Node.js 9 and above.${os.EOL}`));
22}
23