This repository has been archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 🎸 jest @testing-library/react @testing-library/jest-dom * feat: 🎸 $ yarn add --dev jest-environment-jsdom * test: 💍 Specを追加した
- Loading branch information
1 parent
14d8566
commit 18c783c
Showing
5 changed files
with
2,036 additions
and
35 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
__tests__/components/events-in-event/sosenkyo-book/Contacts.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { expect } from '@jest/globals' | ||
|
||
import Contacts from '@/components/events-in-event/sosenkyo-book/Contacts' | ||
import { render } from '@testing-library/react' | ||
|
||
describe('pages/index の Home コンポーネント', () => { | ||
it('期待どおりであること', () => { | ||
const { getByText } = render(<Contacts />) | ||
|
||
expect(getByText('[email protected]')).toBeTruthy() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { expect } from '@jest/globals' | ||
|
||
// import Home from '@/pages/index' | ||
// import { render } from '@testing-library/react' | ||
|
||
describe('pages/index の Home コンポーネント', () => { | ||
it('期待どおりであること', () => { | ||
expect(1 + 2).toBe(3) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const nextJest = require('next/jest') | ||
|
||
const createJestConfig = nextJest({ | ||
dir: './', | ||
}) | ||
|
||
const customJestConfig = { | ||
testMatch: ['<rootDir>/__tests__/**/*.spec.(j|t)s?(x)'], | ||
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'], | ||
// moduleDirectories: ['node_modules', '<rootDir>/'], | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/$1', | ||
}, | ||
testEnvironment: 'jest-environment-jsdom', | ||
} | ||
|
||
module.exports = createJestConfig(customJestConfig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.