Skip to content

Commit 2d863b6

Browse files
Change Action script to merge reports
1 parent fb4de41 commit 2d863b6

4 files changed

Lines changed: 35 additions & 12 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ jobs:
3636
- name: Install dependencies
3737
run: npm install
3838

39-
- name: Run the tests
39+
- name: Run unit tests
40+
run: npm run test:coverage
41+
42+
- name: Upload unit test coverage to Codecov
43+
uses: codecov/codecov-action@v1
44+
45+
- name: Run Cypress tests
4046
run: npm run e2e:ci
4147

42-
- name: Covert test results
43-
run: npx nyc report --reporter=json --reporter=html
48+
- name: Convert test results
49+
run: npx nyc report --reporter=json
4450

45-
- name: Upload coverage to Codecov
51+
- name: Merge e2e coverage
4652
uses: codecov/codecov-action@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ speed-measure-plugin*.json
3838
/.sass-cache
3939
/connect.lock
4040
/coverage
41+
/.nyc_output
4142
/libpeerconnection.log
4243
npm-debug.log
4344
yarn-error.log
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { TestBed } from '@angular/core/testing';
2+
import { HttpClientTestingModule } from '@angular/common/http/testing';
3+
import { AuthService } from './auth.service';
4+
5+
let service: AuthService;
6+
7+
beforeEach(() => {
8+
TestBed.configureTestingModule({ providers: [AuthService], imports: [HttpClientTestingModule] });
9+
});
10+
11+
it('should create', () => {
12+
service = TestBed.inject(AuthService);
13+
expect(service).toBeTruthy();
14+
});

src/app/features/after-login/after-login.component.spec.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2-
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
33
import { MatNativeDateModule } from '@angular/material/core';
44
import { MatDatepickerModule } from '@angular/material/datepicker';
55
import { ScamComponent } from '@shared/components/scam/scam.component';
@@ -11,13 +11,15 @@ describe('AfterLoginComponent', () => {
1111
let component: AfterLoginComponent;
1212
let fixture: ComponentFixture<AfterLoginComponent>;
1313

14-
beforeEach(async () => {
15-
await TestBed.configureTestingModule({
16-
declarations: [AfterLoginComponent, ScamComponent],
17-
imports: [SharedModule, MatDatepickerModule, MatNativeDateModule],
18-
schemas: [CUSTOM_ELEMENTS_SCHEMA],
19-
}).compileComponents();
20-
});
14+
beforeEach(
15+
waitForAsync(() => {
16+
TestBed.configureTestingModule({
17+
declarations: [AfterLoginComponent, ScamComponent],
18+
imports: [SharedModule, MatDatepickerModule, MatNativeDateModule],
19+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
20+
}).compileComponents();
21+
})
22+
);
2123

2224
beforeEach(() => {
2325
fixture = TestBed.createComponent(AfterLoginComponent);

0 commit comments

Comments
 (0)