Skip to main content
Glama
push-based

Angular Toolkit MCP

by push-based
e2e-setup.ts1.75 kB
import path from 'node:path'; import fs from 'node:fs/promises'; export function getE2eAppProjectName(): string | undefined { const e2eProjectName = process.env['NX_TASK_TARGET_PROJECT'] ?? ''; if (e2eProjectName == null) { console.warn('NX_TASK_TARGET_PROJECT is not set.'); } return e2eProjectName ? `${e2eProjectName}-app` : undefined; } export async function setupE2eApp( fixtureProjectName: string, e2eFixtures?: string, ) { const targetProjectName = getE2eAppProjectName() ?? fixtureProjectName + '-e2e-app'; const fixture = path.join( __dirname, `../../../e2e/fixtures/${fixtureProjectName}`, ); const target = path.join( __dirname, `../../../e2e/__test__/${targetProjectName}`, ); try { await fs.stat(fixture); } catch (ctx) { console.warn( `Fixture folder not found. Did you change the file or move it? Error: ${ (ctx as Error).message }`, ); return; } // copy fixtures folder await fs.rm(target, { recursive: true, force: true }); await fs.cp(fixture, target, { recursive: true, force: true, filter(source: string, _: string): boolean | Promise<boolean> { return !source.includes('node_modules') && !source.includes('dist'); }, }); // adjust package.json#nx to new location and rename project const packageJson = ( await fs.readFile(path.join(target, 'package.json'), 'utf-8') ).toString(); await fs.writeFile( path.join(target, 'package.json'), packageJson .replaceAll('fixtures', '__test__') .replaceAll(fixtureProjectName, targetProjectName), ); // add e2e fixtures if (e2eFixtures) { await fs.cp(e2eFixtures, target, { recursive: true, force: true, }); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/push-based/angular-toolkit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server