Skip to content

Commit 5f80191

Browse files
committed
test: update gatsby config in the e2e test
1 parent 0643b52 commit 5f80191

File tree

5 files changed

+1032
-1391
lines changed

5 files changed

+1032
-1391
lines changed

e2e/.presetterrc.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
2-
"preset": "presetter-preset-strict",
2+
"preset": ["presetter-preset-strict", "presetter-preset-react"],
33
"config": {
4-
"gitignore": ["/.cache", "/public", "/screenshots", "/types/~*", "/videos"],
4+
"gitignore": [
5+
"/.cache",
6+
"/public",
7+
"/screenshots",
8+
"/types/~*",
9+
"/videos",
10+
"gatsby-types.d.ts"
11+
],
512
"tsconfig": {
613
"compilerOptions": {
714
"lib": ["DOM"],
@@ -12,6 +19,5 @@
1219
"variable": {
1320
"source": "src",
1421
"output": "public"
15-
},
16-
"ignores": [".babelrc.json"]
22+
}
1723
}

e2e/gatsby-config.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,15 @@
2020

2121
import type { GatsbyConfig } from 'gatsby';
2222

23+
export const graphqlTypegen: GatsbyConfig['graphqlTypegen'] = true;
24+
25+
export const jsxRuntime: GatsbyConfig['jsxRuntime'] = 'automatic';
26+
2327
export const plugins: GatsbyConfig['plugins'] = [
24-
{
25-
resolve: 'gatsby-plugin-graphql-codegen',
26-
options: {
27-
fileName: './types/~graphql.ts',
28-
documentPaths: ['./src/**/*.{ts,tsx}'],
29-
},
30-
},
3128
{
3229
resolve: 'gatsby-source-notion',
3330
options: {
3431
previewCallRate: 0.5,
3532
},
3633
},
3734
];
38-
39-
export default {
40-
plugins,
41-
};

e2e/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
},
1313
"devDependencies": {
1414
"cypress": "^8.7.0",
15-
"gatsby-plugin-graphql-codegen": "^3.0.0",
1615
"presetter": "^3.0.0",
16+
"presetter-preset-react": "^3.0.0",
1717
"presetter-preset-strict": "^3.0.0",
1818
"start-server-and-test": "^1.0.0"
1919
},
2020
"dependencies": {
21-
"gatsby": "^4.0.0"
21+
"gatsby": "^4.0.0",
22+
"react": "^17.0.0"
2223
}
2324
}

e2e/src/pages/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
*/
1515

1616
import { graphql } from 'gatsby';
17-
import React from 'react';
1817

1918
import type { PageProps } from 'gatsby';
2019
import type { FC } from 'react';
2120

22-
import type { IndexPageQuery } from '~graphql';
23-
2421
// page query
2522
export const query = graphql`
2623
query IndexPage {
@@ -44,7 +41,7 @@ export const query = graphql`
4441
* @inheritdoc
4542
* @returns a component holding the test page
4643
*/
47-
const Test: FC<PageProps<IndexPageQuery>> = ({ data }) => (
44+
const Test: FC<PageProps<Queries.IndexPageQuery>> = ({ data }) => (
4845
<>
4946
<section id="databases">
5047
<h1>Databases</h1>
@@ -58,7 +55,7 @@ const Test: FC<PageProps<IndexPageQuery>> = ({ data }) => (
5855
<h1>Pages</h1>
5956
<ul>
6057
{data.allNotionPage.nodes.map(({ ref, title }) => (
61-
<li key={ref}>{title}</li>
58+
<li key={ref}>{title}</li>
6259
))}
6360
</ul>
6461
</section>
@@ -73,4 +70,3 @@ const Test: FC<PageProps<IndexPageQuery>> = ({ data }) => (
7370
// const Test: FC<PageProps> = ({ data }) => <div>hi!</div>;
7471

7572
export default Test;
76-

0 commit comments

Comments
 (0)