Skip to content

Commit 1da08bd

Browse files
chore: add sample test for Vitest setup
1 parent 8456625 commit 1da08bd

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/app/app.component.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { provideRouter } from '@angular/router';
3+
import { provideLocationMocks } from '@angular/common/testing';
4+
5+
import { AppComponent } from './app.component';
6+
7+
describe('App', () => {
8+
beforeEach(async () => {
9+
await TestBed.configureTestingModule({
10+
imports: [AppComponent],
11+
providers: [provideRouter([]), provideLocationMocks()],
12+
}).compileComponents();
13+
});
14+
15+
it('should create the app', () => {
16+
const fixture = TestBed.createComponent(AppComponent);
17+
const app = fixture.componentInstance;
18+
expect(app).toBeTruthy();
19+
});
20+
});

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@
3030
"strictInjectionParameters": true,
3131
"strictInputAccessModifiers": true,
3232
"strictTemplates": true
33-
}
33+
},
34+
"references": [
35+
{ "path": "tsconfig.spec.json" }
36+
]
3437
}

0 commit comments

Comments
 (0)