text: import {fileURLToPath} from 'url';
  import {dirname, resolve} from 'path';
  import {After, When} from '@cucumber/cucumber';
  import stubbedFs from 'mock-fs';
  
  /* eslint-disable no-underscore-dangle */
  const __filename = fileURLToPath(import.meta.url);
  const __dirname = dirname(__filename);
  /* eslint-enable no-underscore-dangle */
  const stubbedNodeModules = stubbedFs.load(resolve(__dirname, '..', '..', '..', '..', 'node_modules'));
  
  After(function () {
    stubbedFs.restore();
  });
  
  When('the project is scaffolded', async function () {
    // eslint-disable-next-line import/no-extraneous-dependencies,import/no-unresolved
    const {scaffold} = await import('@form8ion/cucumber-esm');
  
    stubbedFs({
      node_modules: stubbedNodeModules
    });
  
    await scaffold({projectRoot: process.cwd()});
  });
  