Skip to content

Commit ea6d05b

Browse files
committed
chore: add github checks for lesson 10
1 parent e641baf commit ea6d05b

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Lesson 10 Pull Request
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths:
7+
- "lesson_10/libraries/**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Use Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Build Lesson 10 with Node.js
25+
working-directory: ./lesson_10/libraries
26+
run: |
27+
npm ci
28+
npm run check

.github/workflows/check_push.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- "lesson_06/expression/**"
1111
- "lesson_07/conditionals/**"
1212
- "lesson_09/types/**"
13+
- "lesson_10/libraries/**"
1314

1415
jobs:
1516
build:
@@ -75,4 +76,10 @@ jobs:
7576
working-directory: ./lesson_09/types
7677
run: ./gradlew check
7778

79+
- name: Build Lesson 10 with Node.js
80+
working-directory: ./lesson_10/libraries
81+
run: |
82+
npm ci
83+
npm run compile
84+
7885

lesson_10/libraries/src/lesson10.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { AppModule } from './app.module.js';
44
import { Loader } from './loaders/loader.js';
55
import { Loaders } from './loaders/loaders.module.js';
66

7+
const IGNORE_LOADER = 'anthonymays';
8+
79
describe('Lesson10Test', () => {
810
let moduleFixture: TestingModule;
911
let loaders: Loader[];
@@ -18,13 +20,20 @@ describe('Lesson10Test', () => {
1820

1921
it('loads loaders that load all items', async () => {
2022
for (const loader of loaders) {
23+
if (loader.getLoaderName() === IGNORE_LOADER) {
24+
continue;
25+
}
2126
const items = await loader.loadData();
2227
expect(items.length).toBe(200);
2328
}
2429
});
2530

2631
it('loads all properties correctly', async () => {
2732
for (const loader of loaders) {
33+
if (loader.getLoaderName() === IGNORE_LOADER) {
34+
continue;
35+
}
36+
2837
const items = await loader.loadData();
2938

3039
const itemsByType = items.reduce((acc, item) => {

0 commit comments

Comments
 (0)