• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IgniteUI / igniteui-cli / 11028706398

25 Sep 2024 07:53AM UTC coverage: 70.407% (-1.0%) from 71.398%
11028706398

Pull #1318

github

web-flow
Merge acd6f62ac into e121a9bbc
Pull Request #1318: Dependency updates iteration 3 - upgrade jasmine and schematics

910 of 1325 branches covered (68.68%)

Branch coverage included in aggregate %.

71 of 72 new or added lines in 14 files covered. (98.61%)

80 existing lines in 5 files now uncovered.

4731 of 6687 relevant lines covered (70.75%)

85.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.47
/packages/ng-schematics/src/prompt/SchematicsPromptSession.ts
1
import { SchematicContext, Tree } from "@angular-devkit/schematics";
2
import { IgniteUIForAngularTemplate } from "@igniteui/angular-templates";
3
import {
1✔
4
        BasePromptSession, BaseTemplateManager, Framework,
5
        IUserInputOptions, ProjectConfig, ProjectLibrary, ProjectTemplate, PromptTaskContext, Task
6
} from "@igniteui/cli-core";
7
import { of } from "rxjs";
1✔
8
import { TemplateOptions } from "../component/schema";
9

10
export class SchematicsPromptSession extends BasePromptSession {
1✔
11

12
        public tree: Tree;
13
        public context: SchematicContext;
14
        public projectName: string;
15
        public userAnswers: Map<string, any>;
16

17
        constructor(
18
                templateManager: BaseTemplateManager) {
19
                super(templateManager);
2✔
20
                this.config = ProjectConfig.getConfig();
2✔
21
        }
22

23
        public setContext(context: SchematicContext, tree: Tree, projectName: string) {
UNCOV
24
                this.context = context;
×
UNCOV
25
                this.tree = tree;
×
UNCOV
26
                this.projectName = projectName;
×
UNCOV
27
                this.userAnswers = new Map<string, any>();
×
28
        }
29

30
        public async getUserInput(options: IUserInputOptions, withBackChoice: boolean = false): Promise<string> {
3✔
31
                return super.getUserInput(options, withBackChoice);
3✔
32
        }
33

34
        public async getProjectLibrary(framework: Framework): Promise<ProjectLibrary> {
35
                return super.getProjectLibrary(framework);
×
36
        }
37

38
        public async getProjectLibraryByType(framework: Framework, type: string): Promise<ProjectLibrary> {
39
                type = type === "igx-ts" || type === "igx-ts-legacy" ? type : "igx-ts";
2!
40
                framework.projectLibraries = [framework.projectLibraries.find(lib => lib.projectType === type)!];
2✔
41
                return super.getProjectLibrary(framework);
2✔
42
        }
43

44
        public async getProjectTemplate(projectLibrary: ProjectLibrary): Promise<ProjectTemplate> {
45
                return super.getProjectTemplate(projectLibrary);
×
46
        }
47

48
        public async getTheme(projectLibrary: ProjectLibrary): Promise<string> {
49
                return super.getTheme(projectLibrary);
×
50
        }
51

52
        public nameIsValid(name: string, checkFolder = true): boolean {
1✔
53
                return super.nameIsValid(name, checkFolder);
1✔
54
        }
55

56
        protected completeAndRun(_port?: number) {
57
                // TODO?
58
        }
59

60
        protected async upgradePackages() {
61
                this.userAnswers.set("upgradePackages", true);
×
62
        }
63

64
        protected templateSelectedTask(type: "component" | "view" = "component"): Task<PromptTaskContext> {
×
65
                return async (_runner, context) => {
×
66
                        if (!context.template) {
×
67
                                return false;
×
68
                        }
69
                        const name = await this.chooseTemplateName(context.template, type);
×
70
                        if (context.template.hasExtraConfiguration) {
×
71
                                await this.customizeTemplateTask(context.template);
×
72
                        }
73

74
                        const options: TemplateOptions = {
×
75
                                name,
76
                                projectName: this.projectName,
77
                                templateInst: context.template as IgniteUIForAngularTemplate
78
                        };
79
                        const schematic = this.context.schematic.collection.createSchematic("single-component");
×
80
                        await schematic.call(options, of(this.tree), this.context).toPromise();
×
81
                        return true;
×
82
                };
83
        }
84

85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc