Skip to content

Commit

Permalink
CI/NS-5-configure-github-actions (#47)
Browse files Browse the repository at this point in the history
* ci: add github action - code check

* test: fix home page test

* test: test

* test: fix intentional error
  • Loading branch information
Skolaczk authored Jan 27, 2024
1 parent a8f4b68 commit a8bba3a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code check

on:
pull_request:
branches:
- main

jobs:
lint:
name: Eslint, Typescript, prettier and test

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: npm install

- name: ESLint
run: npm run lint

- name: Type check
run: npm run typecheck

- name: Prettier
run: npm run format:check

- name: Tests
run: npm run test
11 changes: 7 additions & 4 deletions src/__tests__/home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ describe('Homepage', () => {
it('renders the Components', () => {
render(<Home />);

const helloWorldElement = screen.getByText('Hello world', {
selector: 'h1',
});
const heading = screen.getByText(
'Next.js + TypeScript + TailwindCSS + Shadcn/ui',
{
selector: 'h1',
}
);

expect(helloWorldElement).toBeInTheDocument();
expect(heading).toBeInTheDocument();
});
});

0 comments on commit a8bba3a

Please sign in to comment.