Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChalkyMuffin committed Jun 15, 2024
1 parent ba617cb commit bef809e
Show file tree
Hide file tree
Showing 5 changed files with 8,840 additions and 4,690 deletions.
7 changes: 7 additions & 0 deletions saraia/__tests__/app/Homepage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {render} from '@testing-library/react';
import {screen} from '@testing-library/react';
import Home from '@/app/page'
it('renders home page', () => {
render(<Home/>)
expect(screen.getByText('Get started by editing app/page.tsx')).toBeInTheDocument
});
19 changes: 19 additions & 0 deletions saraia/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: 'jsdom',
// Add more setup options before each test is run
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
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 saraia/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom'
Loading

0 comments on commit bef809e

Please sign in to comment.