Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/update/Update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export async function updateWorkspace(rootPath: string): Promise<boolean> {
// For React and WebComponents projects without explicit workspaces,
// check for common project patterns like projects/* in addition to src/
workspaces.push(path.join(rootPath, "src"));

// Check for projects/* pattern common in React demo/example repositories
// Only check if projects directory exists to avoid unnecessary glob calls
const projectsDir = path.join(rootPath, "projects");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ describe('<%=ClassName%>Component', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [<%=ClassName%>Component],
imports: [FormsModule, IgxCategoryChartModule]
imports: [FormsModule, IgxCategoryChartModule],
teardown: { destroyAfterEach: false }
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('<%=ClassName%>Component', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [<%=ClassName%>Component],
imports: [IgxFinancialChartModule]
imports: [IgxFinancialChartModule],
teardown: { destroyAfterEach: false }
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"styles": [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"module": "commonjs"
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ describe('<%=ClassName%>Component', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [FormsModule, IgxCategoryChartModule, <%=ClassName%>Component]
imports: [FormsModule, IgxCategoryChartModule, <%=ClassName%>Component],
teardown: { destroyAfterEach: false }
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ describe('<%=ClassName%>Component', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [IgxFinancialChartModule, <%=ClassName%>Component]
imports: [IgxFinancialChartModule, <%=ClassName%>Component],
teardown: { destroyAfterEach: false }
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('<%=ClassName%>Component', () => {

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [IgxLinearGaugeModule, NoopAnimationsModule, <%=ClassName%>Componen]
imports: [IgxLinearGaugeModule, NoopAnimationsModule, <%=ClassName%>Component]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": [
"zone.js",
"zone.js/testing"
Expand Down
13 changes: 0 additions & 13 deletions packages/igx-templates/igx-ts/projects/_base/files/src/test.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"jasmine"
]
},
"files": [
"src/test.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"module": "commonjs"
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
Expand Down
10 changes: 5 additions & 5 deletions spec/unit/packageManager-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,35 +479,35 @@ describe("Unit - Package Manager", () => {
// spyOn(require("module"), "_load").and.returnValue(mockRequire);
spyOn(Util, "log");
spyOn(App.container, "get").and.returnValue(mockFs);

const createMockChild = (exitCode: number, stdoutData: string, stderrData: string) => {
const mockChild = {
stdout: { on: jasmine.createSpy() },
stderr: { on: jasmine.createSpy() },
on: jasmine.createSpy()
};

// Setup stdout data handler
mockChild.stdout.on.and.callFake((event: string, handler: any) => {
if (event === 'data') {
setTimeout(() => handler(Buffer.from(stdoutData)), 10);
}
});

// Setup stderr data handler
mockChild.stderr.on.and.callFake((event: string, handler: any) => {
if (event === 'data') {
setTimeout(() => handler(Buffer.from(stderrData)), 10);
}
});

// Setup close handler
mockChild.on.and.callFake((event: string, handler: any) => {
if (event === 'close') {
setTimeout(() => handler(exitCode), 20);
}
});

return mockChild;
};

Expand Down
10 changes: 5 additions & 5 deletions spec/unit/update-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ export default function Home() {
(fsSpy.directoryExists as jasmine.Spy).and.callFake((dirPath: string) => {
return dirPath.includes("projects/charts") || dirPath.includes("projects") || dirPath.endsWith("/src");
});

// Mock glob to simulate finding workspace directories and files
(fsSpy.glob as jasmine.Spy).and.callFake((dirPath: string, pattern: string) => {
if (pattern === "projects/*") {
Expand All @@ -826,7 +826,7 @@ export default function Home() {
}
return [];
});

(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
if (filePath.indexOf("package.json") < 0) {
return;
Expand All @@ -842,7 +842,7 @@ export default function Home() {
for (const fileEntry of mockFileArray) {
expect((fsSpy.writeFile as jasmine.Spy)).toHaveBeenCalledWith(fileEntry.path, fileEntry.expected);
}
// Expect: 1 for projects/*, 1 for package.json files at root, 1 for logic files, 1 for style files, 1 for package.json in workspace, 1 for vite.config.ts
// Expect: 1 for projects/*, 1 for package.json files at root, 1 for logic files, 1 for style files, 1 for package.json in workspace, 1 for vite.config.ts
expect(fsSpy.glob).toHaveBeenCalledTimes(7);
});

Expand Down Expand Up @@ -996,7 +996,7 @@ export const GridComponent = () => {
(fsSpy.directoryExists as jasmine.Spy).and.callFake((dirPath: string) => {
return dirPath === "projects" || dirPath.endsWith("/projects") || dirPath.includes("projects/") || dirPath === "src" || dirPath.endsWith("/src");
});

// Mock glob to simulate finding projects directories and files
(fsSpy.glob as jasmine.Spy).and.callFake((dirPath: string, pattern: string) => {
if (pattern === "package.json") {
Expand All @@ -1021,7 +1021,7 @@ export const GridComponent = () => {
}
return [];
});

(fsSpy.readFile as jasmine.Spy).and.callFake((filePath: string) => {
if (filePath.indexOf("package.json") > -1) {
return mockFileArray.find(entry => entry.path === "package.json").content;
Expand Down
Loading