Skip to content

Commit

Permalink
Merge branch 'develop' into feature/53-storybook-shadcn-setup
Browse files Browse the repository at this point in the history
  • Loading branch information
emestabillo committed Mar 13, 2024
2 parents ea25055 + da166dc commit 5405ffa
Show file tree
Hide file tree
Showing 9 changed files with 3,890 additions and 17,388 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
build-and-push:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand All @@ -25,3 +26,25 @@ jobs:
file: ./Dockerfile.dev
push: true
tags: ghcr.io/letsgettechnical/image:dev
#A workflow is for testing
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: tests
run: pnpm test
12 changes: 12 additions & 0 deletions __tests__/Home.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { render, screen } from "@testing-library/react";
import Home from "@/components/Home";

describe("Home", () => {
it("should have Login text", () => {
render(<Home />);

const findElem = screen.getByText("Login");

expect(findElem).toBeInTheDocument();
});
});
7 changes: 7 additions & 0 deletions components/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react'

export default function Home() {
return (
<div>Login</div>
)
}
19 changes: 19 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Config } from "jest";
import nextJest from "next/jest.js";

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: "./",
});

// Add any custom config to be passed to Jest
const config: Config = {
coverageProvider: "v8",
testEnvironment: "jest-environment-jsdom",
// Add more setup options before each test is run
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
preset: "ts-jest",
};

// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
export default createJestConfig(config);
1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
Loading

0 comments on commit 5405ffa

Please sign in to comment.