"Fossies" - the Fresh Open Source Software Archive

Member "angular-cli-15.2.4/tests/legacy-cli/e2e/tests/commands/analytics/analytics-info.ts" (16 Mar 2023, 1023 Bytes) of package /linux/www/angular-cli-15.2.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { execAndWaitForOutputToMatch } from '../../../utils/process';
    2 import { updateJsonFile } from '../../../utils/project';
    3 
    4 export default async function () {
    5   // Should be disabled by default.
    6   await configureTest(undefined /** analytics */);
    7   await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: disabled/, {
    8     NG_FORCE_TTY: '0', // Disable prompts
    9   });
   10 
   11   await configureTest('1dba0835-38a3-4957-bf34-9974e2df0df3' /** analytics */);
   12   await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: enabled/, {
   13     NG_FORCE_TTY: '0', // Disable prompts
   14   });
   15 
   16   await configureTest(false /** analytics */);
   17   await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: disabled/, {
   18     NG_FORCE_TTY: '0', // Disable prompts
   19   });
   20 }
   21 
   22 async function configureTest(analytics: false | string | undefined): Promise<void> {
   23   await updateJsonFile('angular.json', (config) => {
   24     config.cli ??= {};
   25     config.cli.analytics = analytics;
   26   });
   27 }