11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciif (!common.isMainThread) 51cb0ef41Sopenharmony_ci common.skip('process.chdir is not available in Workers'); 61cb0ef41Sopenharmony_ciconst assert = require('assert'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciassert.throws( 91cb0ef41Sopenharmony_ci () => { 101cb0ef41Sopenharmony_ci process.chdir('does-not-exist'); 111cb0ef41Sopenharmony_ci }, 121cb0ef41Sopenharmony_ci { 131cb0ef41Sopenharmony_ci name: 'Error', 141cb0ef41Sopenharmony_ci code: 'ENOENT', 151cb0ef41Sopenharmony_ci message: /ENOENT: no such file or directory, chdir .+ -> 'does-not-exist'/, 161cb0ef41Sopenharmony_ci path: process.cwd(), 171cb0ef41Sopenharmony_ci syscall: 'chdir', 181cb0ef41Sopenharmony_ci dest: 'does-not-exist' 191cb0ef41Sopenharmony_ci } 201cb0ef41Sopenharmony_ci); 21