Skip to content

Commit dc8cb33

Browse files
ci: switch to GH actions and npm (#138)
1 parent 077ecb5 commit dc8cb33

22 files changed

+97
-14132
lines changed

.circleci/config.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: ci
2+
3+
on: pull_request
4+
5+
jobs:
6+
build_and_test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
node-version: [12.x]
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: use Node.js ${{ matrix.node-version }}
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
- name: install
19+
run: npm install
20+
- name: build
21+
run: npm run build --skip-nx-cache
22+
- name: test
23+
run: npm run test --ci --code-coverage

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
if: github.repository == 'testing-library/angular-testing-library'
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [12.x]
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: install
23+
run: npm install
24+
- name: build
25+
run: npm run build --skip-nx-cache
26+
- name: test
27+
run: npm run test --ci --code-coverage
28+
- name: Release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
run: npx semantic-release

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
registry=http://registry.npmjs.org/
1+
registry=http://registry.npmjs.org/
2+
package-lock=false

angular.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"options": {
7979
"jestConfig": "apps/example-app/jest.config.js",
8080
"tsConfig": "apps/example-app/tsconfig.spec.json",
81-
"setupFile": "apps/example-app/setup-jest.ts"
81+
"setupFile": "apps/example-app/test-setup.ts"
8282
}
8383
}
8484
}
@@ -134,7 +134,7 @@
134134
"options": {
135135
"jestConfig": "projects/testing-library/jest.config.js",
136136
"tsConfig": "projects/testing-library/tsconfig.spec.json",
137-
"setupFile": "projects/testing-library/setup-jest.ts"
137+
"setupFile": "projects/testing-library/test-setup.ts"
138138
}
139139
}
140140
}
@@ -181,7 +181,7 @@
181181
"options": {
182182
"jestConfig": "projects/jest-utils/jest.config.js",
183183
"tsConfig": "projects/jest-utils/tsconfig.spec.json",
184-
"setupFile": "projects/jest-utils/setup-jest.ts"
184+
"setupFile": "projects/jest-utils/test-setup.ts"
185185
}
186186
}
187187
}

apps/example-app/app/examples/04-forms-with-material.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('is possible to fill in a form and verify error messages (with the help of
1111

1212
const nameControl = screen.getByLabelText(/name/i);
1313
const scoreControl = screen.getByRole('spinbutton', { name: /score/i });
14-
const colorControl = screen.getByRole('listbox', { name: /color/i });
14+
const colorControl = screen.getByRole('combobox', { name: /color/i });
1515
const errors = screen.getByRole('alert');
1616

1717
expect(errors).toContainElement(screen.queryByText('name is required'));

apps/example-app/app/examples/07-with-ngrx-mock-store.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('works with provideMockStore', async () => {
2121
const store = TestBed.inject(MockStore);
2222
store.dispatch = jest.fn();
2323

24-
fireEvent.click(screen.getByRole('listitem', { name: /seven/i }));
24+
fireEvent.click(screen.getByText(/seven/i));
2525

2626
expect(store.dispatch).toBeCalledWith({ type: '[Item List] send', item: 'Seven' });
2727
});

apps/example-app/app/examples/07-with-ngrx-mock-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const selectItems = createSelector(
1010
selector: 'app-fixture',
1111
template: `
1212
<ul>
13-
<li *ngFor="let item of items | async" (click)="send(item)" [attr.aria-label]="item">{{ item }}</li>
13+
<li *ngFor="let item of items | async" (click)="send(item)">{{ item }}</li>
1414
</ul>
1515
`,
1616
})

apps/example-app/app/examples/13-scrolling.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { render, screen, waitForElementToBeRemoved } from '@testing-library/angular';
22

3-
import { CdkVirtualScrollOverviewExample } from './13-scrolling.component';
3+
import { CdkVirtualScrollOverviewExampleComponent } from './13-scrolling.component';
44
import { ScrollingModule } from '@angular/cdk/scrolling';
55

66
test('should scroll to load more items', async () => {
7-
await render(CdkVirtualScrollOverviewExample, {
7+
await render(CdkVirtualScrollOverviewExampleComponent, {
88
imports: [ScrollingModule],
99
});
1010

apps/example-app/app/examples/13-scrolling.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChangeDetectionStrategy, Component } from '@angular/core';
22

33
@Component({
4-
selector: 'cdk-virtual-scroll-overview-example',
4+
selector: 'app-cdk-virtual-scroll-overview-example',
55
template: `
66
<cdk-virtual-scroll-viewport itemSize="50" class="example-viewport" data-testid="scroll-viewport">
77
<div *cdkVirtualFor="let item of items" class="example-item">{{ item }}</div>
@@ -22,6 +22,6 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
2222
],
2323
changeDetection: ChangeDetectionStrategy.OnPush,
2424
})
25-
export class CdkVirtualScrollOverviewExample {
25+
export class CdkVirtualScrollOverviewExampleComponent {
2626
items = Array.from({ length: 100 }).map((_, i) => `Item #${i}`);
2727
}

0 commit comments

Comments
 (0)