11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst { mustNotMutateObjectDeep } = require('../common');
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst fs = require('fs');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci{
81cb0ef41Sopenharmony_ci  const fd = 'k';
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ci  assert.throws(
111cb0ef41Sopenharmony_ci    () => {
121cb0ef41Sopenharmony_ci      fs.createReadStream(null, mustNotMutateObjectDeep({ fd }));
131cb0ef41Sopenharmony_ci    },
141cb0ef41Sopenharmony_ci    {
151cb0ef41Sopenharmony_ci      code: 'ERR_INVALID_ARG_TYPE',
161cb0ef41Sopenharmony_ci      name: 'TypeError',
171cb0ef41Sopenharmony_ci    });
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci  assert.throws(
201cb0ef41Sopenharmony_ci    () => {
211cb0ef41Sopenharmony_ci      fs.createWriteStream(null, mustNotMutateObjectDeep({ fd }));
221cb0ef41Sopenharmony_ci    },
231cb0ef41Sopenharmony_ci    {
241cb0ef41Sopenharmony_ci      code: 'ERR_INVALID_ARG_TYPE',
251cb0ef41Sopenharmony_ci      name: 'TypeError',
261cb0ef41Sopenharmony_ci    });
271cb0ef41Sopenharmony_ci}
281cb0ef41Sopenharmony_ci
291cb0ef41Sopenharmony_ci{
301cb0ef41Sopenharmony_ci  const path = 46;
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci  assert.throws(
331cb0ef41Sopenharmony_ci    () => {
341cb0ef41Sopenharmony_ci      fs.createReadStream(path);
351cb0ef41Sopenharmony_ci    },
361cb0ef41Sopenharmony_ci    {
371cb0ef41Sopenharmony_ci      code: 'ERR_INVALID_ARG_TYPE',
381cb0ef41Sopenharmony_ci      name: 'TypeError',
391cb0ef41Sopenharmony_ci    });
401cb0ef41Sopenharmony_ci
411cb0ef41Sopenharmony_ci  assert.throws(
421cb0ef41Sopenharmony_ci    () => {
431cb0ef41Sopenharmony_ci      fs.createWriteStream(path);
441cb0ef41Sopenharmony_ci    },
451cb0ef41Sopenharmony_ci    {
461cb0ef41Sopenharmony_ci      code: 'ERR_INVALID_ARG_TYPE',
471cb0ef41Sopenharmony_ci      name: 'TypeError',
481cb0ef41Sopenharmony_ci    });
491cb0ef41Sopenharmony_ci}
50