Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 58048cc

Browse files
authored
Updates (#100) 🚀
* Setup new branch for pdates * Updated gatsby and other deps 🚀 * Fix test setp for jest 28 🚀 * Fix jest window scrollTo mock 🚀 * Added right config for jest test url 🚀 * ready for merge 🚀
1 parent 919ddd0 commit 58048cc

File tree

7 files changed

+8822
-7141
lines changed

7 files changed

+8822
-7141
lines changed

__tests__/gallery.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ const images = [
6666

6767
describe("Gallery", () => {
6868
it("shows the image when the user clicks on it", async () => {
69+
window.scrollTo = jest.fn();
70+
6971
render(
7072
<BlogThemePage>
7173
<Gallery images={images} />
@@ -77,5 +79,7 @@ describe("Gallery", () => {
7779
const modal = screen.getByAltText("Modal Image");
7880

7981
expect(modal).toBeDefined();
82+
83+
jest.clearAllMocks();
8084
});
8185
});

graphql-types.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ export type DirectoryCtimeArgs = {
247247
export type Site = Node & {
248248
buildTime?: Maybe<Scalars['Date']>;
249249
siteMetadata?: Maybe<SiteSiteMetadata>;
250-
port?: Maybe<Scalars['Int']>;
251-
host?: Maybe<Scalars['String']>;
252250
polyfill?: Maybe<Scalars['Boolean']>;
253251
pathPrefix?: Maybe<Scalars['String']>;
254252
jsxRuntime?: Maybe<Scalars['String']>;
@@ -848,8 +846,6 @@ export type QueryAllDirectoryArgs = {
848846
export type QuerySiteArgs = {
849847
buildTime?: InputMaybe<DateQueryOperatorInput>;
850848
siteMetadata?: InputMaybe<SiteSiteMetadataFilterInput>;
851-
port?: InputMaybe<IntQueryOperatorInput>;
852-
host?: InputMaybe<StringQueryOperatorInput>;
853849
polyfill?: InputMaybe<BooleanQueryOperatorInput>;
854850
pathPrefix?: InputMaybe<StringQueryOperatorInput>;
855851
jsxRuntime?: InputMaybe<StringQueryOperatorInput>;
@@ -2162,8 +2158,6 @@ export type SiteFieldsEnum =
21622158
| 'siteMetadata___contacts___links___medium'
21632159
| 'siteMetadata___contacts___links___devto'
21642160
| 'siteMetadata___contacts___links___instagram'
2165-
| 'port'
2166-
| 'host'
21672161
| 'polyfill'
21682162
| 'pathPrefix'
21692163
| 'jsxRuntime'
@@ -2299,8 +2293,6 @@ export type SiteGroupConnectionGroupArgs = {
22992293
export type SiteFilterInput = {
23002294
buildTime?: InputMaybe<DateQueryOperatorInput>;
23012295
siteMetadata?: InputMaybe<SiteSiteMetadataFilterInput>;
2302-
port?: InputMaybe<IntQueryOperatorInput>;
2303-
host?: InputMaybe<StringQueryOperatorInput>;
23042296
polyfill?: InputMaybe<BooleanQueryOperatorInput>;
23052297
pathPrefix?: InputMaybe<StringQueryOperatorInput>;
23062298
jsxRuntime?: InputMaybe<StringQueryOperatorInput>;

jest.config.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@ module.exports = {
66
moduleNameMapper: {
77
".+\\.(css|styl|less|sass|scss)$": `identity-obj-proxy`,
88
".+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": `<rootDir>/__mocks__/file-mock.js`,
9-
"^gatsby-page-utils/(.*)$": `gatsby-page-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
10-
"^gatsby-core-utils/(.*)$": `gatsby-core-utils/dist/$1`, // Workaround for https://github.com/facebook/jest/issues/9771
11-
"^gatsby-plugin-utils/(.*)$": [
12-
`gatsby-plugin-utils/dist/$1`,
13-
`gatsby-plugin-utils/$1`,
14-
], // Workaround for https://github.com/facebook/jest/issues/9771
159
},
1610
testPathIgnorePatterns: [`node_modules`, `\\.cache`, `<rootDir>.*/public`],
1711
transformIgnorePatterns: [`node_modules/(?!(gatsby)/)`],
1812
globals: {
1913
__PATH_PREFIX__: ``,
2014
},
21-
testURL: `http://localhost`,
15+
testEnvironmentOptions: {
16+
url: `http://localhost`,
17+
},
2218
setupFiles: [`<rootDir>/loadershim.js`],
2319
setupFilesAfterEnv: ["<rootDir>/jest-setup.js"],
2420
};

0 commit comments

Comments
 (0)