Skip to content

Commit b33c7bc

Browse files
committed
package upgrades, cypress migration
1 parent 009d246 commit b33c7bc

File tree

12 files changed

+6217
-7238
lines changed

12 files changed

+6217
-7238
lines changed

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@ yarn-error.log
6969
.yarn-integrity
7070

7171
# Cypress
72-
cypress
73-
tests/screenshots
74-
tests/videos
72+
cypress/downloads
73+
cypress/screenshots
74+
cypress/videos

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12
1+
14

cypress.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { defineConfig } = require("cypress");
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
baseUrl: "http://localhost:8000/",
6+
},
7+
});

cypress.json

-9
This file was deleted.
File renamed without changes.

cypress/fixtures/example.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "Using fixtures to represent data",
3+
"email": "[email protected]",
4+
"body": "Fixtures are a great way to mock data for responses to routes"
5+
}

tests/cypress-commands.js cypress/support/commands.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
//
1111
//
1212
// -- This is a parent command --
13-
// Cypress.Commands.add("login", (email, password) => { ... })
13+
// Cypress.Commands.add('login', (email, password) => { ... })
1414
//
1515
//
1616
// -- This is a child command --
17-
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
17+
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
1818
//
1919
//
2020
// -- This is a dual command --
21-
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
21+
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
2222
//
2323
//
24-
// -- This is will overwrite an existing command --
25-
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
24+
// -- This will overwrite an existing command --
25+
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })

tests/cypress-support.js cypress/support/e2e.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// ***********************************************************
2-
// This example support/index.js is processed and
2+
// This example support/e2e.js is processed and
33
// loaded automatically before your test files.
44
//
55
// This is a great place to put global configuration and
@@ -14,7 +14,7 @@
1414
// ***********************************************************
1515

1616
// Import commands.js using ES2015 syntax:
17-
import "./cypress-commands";
17+
import "./commands";
1818

1919
// Alternatively you can use CommonJS syntax:
2020
// require('./commands')

package.json

+30-30
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
"url": "https://twitter.com/colbyfayock"
1010
},
1111
"dependencies": {
12-
"gatsby": "^3.13.0",
13-
"gatsby-plugin-manifest": "^3.14.0",
14-
"gatsby-plugin-react-helmet": "^4.14.0",
15-
"gatsby-plugin-react-leaflet": "3.0.0",
12+
"cypress": "^10.1.0",
13+
"gatsby": "^4.16.0",
14+
"gatsby-plugin-manifest": "^4.16.0",
15+
"gatsby-plugin-react-helmet": "^5.16.0",
16+
"gatsby-plugin-react-leaflet": "3.0.3",
1617
"gatsby-plugin-resolve-src": "^2.1.0",
17-
"gatsby-plugin-sass": "^4.13.0",
18-
"gatsby-source-filesystem": "^3.5.0",
19-
"gatsby-source-graphql": "^3.5.0",
20-
"leaflet": "^1.7.1",
18+
"gatsby-plugin-sass": "^5.16.0",
19+
"gatsby-source-filesystem": "^4.16.0",
20+
"gatsby-source-graphql": "^4.16.0",
21+
"leaflet": "^1.8.0",
2122
"path": "^0.12.7",
22-
"prop-types": "^15.7.2",
23-
"react": "^17.0.2",
24-
"react-dom": "^17.0.2",
23+
"prop-types": "^15.8.1",
24+
"react": "^18.1.0",
25+
"react-dom": "^18.1.0",
2526
"react-helmet": "^6.1.0",
26-
"react-icons": "^4.2.0",
27-
"react-leaflet": "^3.1.0",
28-
"sass": "^1.39.0"
27+
"react-icons": "^4.4.0",
28+
"react-leaflet": "^4.0.0",
29+
"sass": "^1.52.3"
2930
},
3031
"devDependencies": {
31-
"@babel/eslint-parser": "^7.15.4",
32-
"@babel/preset-react": "^7.14.5",
33-
"babel-jest": "^27.1.0",
34-
"babel-preset-gatsby": "^1.13.0",
35-
"cypress": "^8.3.1",
32+
"@babel/eslint-parser": "^7.18.2",
33+
"@babel/preset-react": "^7.17.12",
34+
"babel-jest": "^28.1.1",
35+
"babel-preset-gatsby": "^2.16.0",
3636
"enzyme": "^3.11.0",
37-
"eslint": "^7.32.0",
38-
"eslint-plugin-cypress": "^2.11.3",
39-
"eslint-plugin-react": "^7.25.1",
40-
"eslint-plugin-react-hooks": "^4.2.0",
37+
"eslint": "^8.17.0",
38+
"eslint-plugin-cypress": "^2.12.1",
39+
"eslint-plugin-react": "^7.30.0",
40+
"eslint-plugin-react-hooks": "^4.5.0",
4141
"husky": "4.3.8",
42-
"jest": "^27.1.0",
43-
"lint-staged": "^11.1.2",
44-
"prettier": "^2.5.0",
45-
"prettier-eslint": "^13.0.0",
46-
"prettier-eslint-cli": "^5.0.1",
42+
"jest": "^28.1.1",
43+
"lint-staged": "^13.0.1",
44+
"prettier": "^2.7.0",
45+
"prettier-eslint": "^15.0.1",
46+
"prettier-eslint-cli": "^6.0.1",
4747
"start-server-and-test": "^1.14.0"
4848
},
4949
"keywords": [
@@ -62,8 +62,8 @@
6262
"cy:run": "cypress run --headless",
6363
"cy:verify": "cypress verify",
6464
"develop": "gatsby develop",
65-
"format": "prettier-eslint --eslint-config-path ./config/eslint.config.js --write $PWD/'**/*.js'",
66-
"format:nopath": "prettier-eslint --eslint-config-path ./config/eslint.config.js --write",
65+
"format": "prettier-eslint --eslint-config-path $PWD/config/eslint.config.js --write $PWD/'**/*.js'",
66+
"format:nopath": "prettier-eslint --eslint-config-path $PWD/config/eslint.config.js --write",
6767
"lint": "eslint -c ./config/eslint.config.js . --ext .js",
6868
"start": "yarn develop",
6969
"serve": "gatsby serve",

src/pages/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useRef, useEffect } from "react";
2+
import PropTypes from "prop-types";
23
import { Helmet } from "react-helmet";
34
import L from "leaflet";
45
import { Marker, useMap } from "react-leaflet";
@@ -81,6 +82,10 @@ const MapEffect = ({ markerRef }) => {
8182
return null;
8283
};
8384

85+
MapEffect.propTypes = {
86+
markerRef: PropTypes.object,
87+
};
88+
8489
const IndexPage = () => {
8590
const markerRef = useRef();
8691

tests/cypress-plugins.js

-17
This file was deleted.

0 commit comments

Comments
 (0)