-
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.
tests(#57): fix Jest configuration and tests
- Loading branch information
1 parent
2550f58
commit cb047e3
Showing
11 changed files
with
198 additions
and
183 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
- Run the tasks directly in Dev Containers like before | ||
- Configure Jest to be able to write tests in TypeScript | ||
- Make Cypress tests run | ||
- Make Cypress work with both Xorg and Wayland | ||
- Run the tasks directly in Dev Containers like before? |
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 |
---|---|---|
@@ -1,121 +1,39 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders homepage unchanged 1`] = ` | ||
exports[`renders homepage 1`] = ` | ||
<div> | ||
<div | ||
class="container" | ||
class="main" | ||
> | ||
<main | ||
class="main" | ||
<div | ||
class="intro" | ||
> | ||
<h1 | ||
class="title" | ||
> | ||
Welcome to | ||
<a | ||
href="https://nextjs.org" | ||
> | ||
Next.js! | ||
</a> | ||
</h1> | ||
<p | ||
class="description" | ||
<div | ||
class="hello" | ||
> | ||
Get started by editing | ||
<code | ||
class="code" | ||
> | ||
pages/index.js | ||
</code> | ||
</p> | ||
Hello, I'm Damien Carcel. | ||
</div> | ||
<div | ||
class="grid" | ||
class="about" | ||
> | ||
<a | ||
class="card" | ||
href="/about" | ||
> | ||
<h2> | ||
About Page → | ||
</h2> | ||
<p> | ||
Cypress will test if this link is working. | ||
</p> | ||
</a> | ||
<a | ||
class="card" | ||
href="https://nextjs.org/docs" | ||
> | ||
<h2> | ||
Documentation → | ||
</h2> | ||
<p> | ||
Find in-depth information about Next.js features and API. | ||
</p> | ||
</a> | ||
<a | ||
class="card" | ||
href="https://nextjs.org/learn" | ||
> | ||
<h2> | ||
Learn → | ||
</h2> | ||
<p> | ||
Learn about Next.js in an interactive course with quizzes! | ||
</p> | ||
</a> | ||
<a | ||
class="card" | ||
href="https://github.com/vercel/next.js/tree/canary/examples" | ||
> | ||
<h2> | ||
Examples → | ||
</h2> | ||
<p> | ||
Discover and deploy boilerplate example Next.js projects. | ||
</p> | ||
</a> | ||
<a | ||
class="card" | ||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
<h2> | ||
Deploy → | ||
</h2> | ||
<p> | ||
Instantly deploy your Next.js site to a public URL with Vercel. | ||
</p> | ||
</a> | ||
I like to craft software. | ||
</div> | ||
</main> | ||
<footer | ||
class="footer" | ||
</div> | ||
<div | ||
class="photo" | ||
> | ||
<a | ||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
Powered by | ||
<span | ||
class="logo" | ||
> | ||
<img | ||
alt="Vercel Logo" | ||
data-nimg="1" | ||
decoding="async" | ||
height="16" | ||
loading="lazy" | ||
src="/vercel.svg" | ||
style="color: transparent;" | ||
width="72" | ||
/> | ||
</span> | ||
</a> | ||
</footer> | ||
<img | ||
alt="me.jpg" | ||
data-nimg="1" | ||
decoding="async" | ||
height="320" | ||
loading="lazy" | ||
src="/_next/image?url=%2Fme.jpg&w=640&q=75" | ||
srcset="/_next/image?url=%2Fme.jpg&w=384&q=75 1x, /_next/image?url=%2Fme.jpg&w=640&q=75 2x" | ||
style="color: transparent;" | ||
width="320" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
`; |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { render } from '@testing-library/react'; | ||
import Home from '../pages/index'; | ||
|
||
it('renders homepage unchanged', () => { | ||
import Home from '@/app/page'; | ||
|
||
it('renders homepage', () => { | ||
const { container } = render(<Home />); | ||
expect(container).toMatchSnapshot(); | ||
}); |
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import nextJest from 'next/jest.js' | ||
import nextJest from 'next/jest.js'; | ||
|
||
const createJestConfig = nextJest({ | ||
dir: './', | ||
}) | ||
}); | ||
|
||
/** @type {import('jest').Config} */ | ||
const config = { | ||
testEnvironment: 'jest-environment-jsdom', | ||
} | ||
}; | ||
|
||
export default createJestConfig(config) | ||
export default createJestConfig(config); |
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 @@ | ||
import '@testing-library/jest-dom'; |
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.