11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_cirequire('../common'); 31cb0ef41Sopenharmony_ciconst assert = require('assert'); 41cb0ef41Sopenharmony_ciconst os = require('os'); 51cb0ef41Sopenharmony_ciconst cp = require('child_process'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ciif (process.argv[2] === 'child') { 81cb0ef41Sopenharmony_ci const { internalBinding } = require('internal/test/binding'); 91cb0ef41Sopenharmony_ci // This is the heart of the test. 101cb0ef41Sopenharmony_ci new (internalBinding('zlib').Zlib)(0).init(1, 2, 3, 4, 5); 111cb0ef41Sopenharmony_ci} else { 121cb0ef41Sopenharmony_ci const child = cp.spawnSync( 131cb0ef41Sopenharmony_ci `${process.execPath}`, ['--expose-internals', `${__filename}`, 'child']); 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci assert.strictEqual(child.stdout.toString(), ''); 161cb0ef41Sopenharmony_ci assert.ok(child.stderr.includes( 171cb0ef41Sopenharmony_ci 'WARNING: You are likely using a version of node-tar or npm that ' + 181cb0ef41Sopenharmony_ci `is incompatible with this version of Node.js.${os.EOL}` + 191cb0ef41Sopenharmony_ci 'Please use either the version of npm that is bundled with Node.js, or ' + 201cb0ef41Sopenharmony_ci 'a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is ' + 211cb0ef41Sopenharmony_ci `compatible with Node.js 9 and above.${os.EOL}`)); 221cb0ef41Sopenharmony_ci} 23