Skip to content

Commit

Permalink
Fix unit tests setup
Browse files Browse the repository at this point in the history
  • Loading branch information
DraTeots committed May 8, 2024
1 parent e20b6f4 commit 7d7f18c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion firebird-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test-headless": "ng test --watch=false --browsers=ChromeHeadlessCI"
"test-headless": "ng test --browsers=ChromeHeadless --watch=false --code-coverage --progress=false"
},
"private": true,
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion firebird-ng/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
import {provideRouter} from '@angular/router';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
providers: [provideRouter([])],
}).compileComponents();
});

Expand Down
8 changes: 4 additions & 4 deletions firebird-ng/src/app/geometry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class GeometryService {
"Default/SweeperMag*",
"Default/AnalyzerMag*",
"*ZDC*",
"*AstroPix_Module_*",
"Default/Ecal*/fiber_grid*",
//"*AstroPix_Module_*",
//"Default/Ecal*/fiber_grid*",
];

this.fineTuneRules = [
Expand Down Expand Up @@ -132,13 +132,13 @@ export class GeometryService {
//
analyzeGeoNodes(geoManager, 1);
console.time('Prune nodes coarse');
// editGeoNodes(geoManager, this.totalRules, 1)
editGeoNodes(geoManager, this.totalRules, 1)
console.timeEnd('Prune nodes coarse');

// >oO analyzeGeoNodes(geoManager, 1);

console.time('Prune nodes fine');
editGeoNodes(geoManager, this.totalRules, 15)
// editGeoNodes(geoManager, this.totalRules, 15)
console.timeEnd('Prune nodes fine');

//analyzeGeoNodes(geoManager, 1);
Expand Down
7 changes: 3 additions & 4 deletions firebird-ng/src/app/utils/cern-root.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ describe('findGeoNodes', () => {
};

it('should return only nodes matching the specified pattern', () => {
const pattern = "*Child*";
const pattern = "*Child2*";
const results = findGeoNodes(rootNode, pattern);
expect(results.length).toBe(2);
expect(results[0].fullPath).toContain('Root/Child1');
expect(results[1].fullPath).toContain('Root/Child2');
expect(results.length).toBe(1);
expect(results[0].fullPath).toContain('Root/Child2');
});

it('should return an empty array if no nodes match the pattern', () => {
Expand Down

0 comments on commit 7d7f18c

Please sign in to comment.