From 822f44b8b67ec908b29024daf35f8453c61562ec Mon Sep 17 00:00:00 2001 From: Oskari Heinonen Date: Mon, 12 Jul 2021 15:20:38 +0300 Subject: [PATCH] CircleCI config updated --- .circleci/config.yml | 83 +++-- .gitignore | 8 +- cypress/integration/home-page.spec.ts | 1 + cypress/plugins/index.ts | 17 +- ...ge -- successfully loads homepage.snap.png | Bin 0 -> 7001 bytes cypress/support/index.ts | 9 +- jest.config.js | 2 +- jest.setup.ts | 4 - jest/jest.setup.ts | 10 + ...tsx-should-match-image-snapshot-1-snap.png | Bin package-lock.json | 316 ++++++++++++++++++ package.json | 3 +- 12 files changed, 409 insertions(+), 44 deletions(-) create mode 100644 cypress/snapshots/current_output/home-page.spec.ts/The Home Page -- successfully loads homepage.snap.png delete mode 100644 jest.setup.ts create mode 100644 jest/jest.setup.ts rename {src/components/welcome/__image_snapshots__ => jest/snapshots/current_output}/welcome-test-tsx-should-match-image-snapshot-1-snap.png (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 176584c..aa0cfbe 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,56 +13,94 @@ executors: - *node jobs: - build: + install: executor: node steps: - checkout: path: ~/project/build_path - restore_cache: - key: v1-circleci-nextjs-project-{{ .Branch }}-{{ .Revision }} + keys: + - v1-circleci-nextjs-dependecies-{{ .Branch }}-{{ .Revision }} - run: name: Install Dependencies - command: cd build_path && npm install - - run: - name: Build - command: cd build_path && npm run build - - # Cache node_modules for tests. + command: cd build_path && npm ci - save_cache: - key: v1-circleci-nextjs-project-{{ .Branch }}-{{ .Revision }} + key: v1-circleci-nextjs-dependecies-{{ .Branch }}-{{ .Revision }} paths: - - build_path - - unit-test: + - ~/.npm + - ~/.cache + jest: docker: - image: circleci/node:12.16.1-browsers resource_class: large steps: - - checkout + - checkout: + path: ~/project/build_path - restore_cache: - key: v1-circleci-nextjs-project-{{ .Branch }}-{{ .Revision }} + key: v1-circleci-nextjs-dependecies-{{ .Branch }}-{{ .Revision }} + - run: + name: Install dependecies + command: cd build_path && npm ci - run: name: Jest tests command: cd build_path && npm run test:jest - store_artifacts: - path: ~/project/build_path/src/tests/__image_snapshots__/__diff_output__ - destination: diff_output + path: ~/project/build_path/jest/snapshots/diff_output + # destination: jest/diff_output - run: name: Update image snapshots when tests fails command: cd build_path && npm run test:jest:update when: on_fail - store_artifacts: - path: ~/project/build_path/src/tests/__image_snapshots__ - destination: image_snapshots - + path: ~/project/build_path/jest/snapshots/current_output + # destination: jest/image_snapshots + cypress: + docker: + - image: circleci/node:12.16.1-browsers + resource_class: large + steps: + - checkout: + path: ~/project/build_path + - restore_cache: + key: v1-circleci-nextjs-dependecies-{{ .Branch }}-{{ .Revision }} + - run: + name: Install dependecies + command: cd build_path && npm ci + - run: + name: Build application + command: cd build_path && npm run build + - run: + name: Run application + command: cd build_path && npm run start + background: true + - run: + name: Cypress tests + command: cd build_path && npm run test:cypress:run + - store_artifacts: + path: ~/project/build_path/cypress/screenshots + # destination: cypress/screenshots + - store_artifacts: + path: ~/project/build_path/cypress/snapshots/diff_output + # destination: cypress/diff_output + - run: + name: Update image snapshots when tests fails + command: cd build_path && npm run test:cypress:run:update + when: on_fail + - store_artifacts: + path: ~/project/build_path/cypress/snapshots/current_output + # destination: cypress/image_snapshots + workflows: version: 2 commit: jobs: - - build - - unit-test: + - install + - jest: + requires: + - install + - cypress: requires: - - build + - install # silta/frontend-build-deploy is defined here https://github.com/wunderio/silta-circleci/blob/master/orb/jobs/%40frontend.yml # &build-deploy is a yaml anchor, so we can reference it later - silta/frontend-build-deploy: &frontend-build-deploy @@ -75,7 +113,6 @@ workflows: filters: branches: ignore: production - - silta/frontend-build-deploy: # Extend the build-deploy configuration for the production environment. <<: *frontend-build-deploy diff --git a/.gitignore b/.gitignore index 1437c53..d763df6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,12 @@ /.pnp .pnp.js -# testing -/coverage +# testing image snapshot diffs +/cypress/snapshots/diff_output +/jest/snapshots/diff_output + +# cypress screenshots +/cypress/screenshots # next.js /.next/ diff --git a/cypress/integration/home-page.spec.ts b/cypress/integration/home-page.spec.ts index afd4e65..21abfb3 100644 --- a/cypress/integration/home-page.spec.ts +++ b/cypress/integration/home-page.spec.ts @@ -7,5 +7,6 @@ import { describe("The Home Page", () => { it("successfully loads homepage", () => { cy.visit("/"); + cy.matchImageSnapshot(); }); }); diff --git a/cypress/plugins/index.ts b/cypress/plugins/index.ts index 27b265c..7811424 100644 --- a/cypress/plugins/index.ts +++ b/cypress/plugins/index.ts @@ -1,14 +1,7 @@ /// -// const { initPlugin } = require("cypress-plugin-snapshots/plugin"); +import { addMatchImageSnapshotPlugin } from "cypress-image-snapshot/plugin"; -// module.exports = (on, config) => { -// initPlugin(on, config); -// return config; -// }; - -// import { initPlugin } from "cypress-plugin-snapshots/plugin"; - -// export default (on, config) => { -// initPlugin(on, config); -// return config; -// }; +export default (on, config) => { + addMatchImageSnapshotPlugin(on, config); + return config; +}; diff --git a/cypress/snapshots/current_output/home-page.spec.ts/The Home Page -- successfully loads homepage.snap.png b/cypress/snapshots/current_output/home-page.spec.ts/The Home Page -- successfully loads homepage.snap.png new file mode 100644 index 0000000000000000000000000000000000000000..ed059d8e9fba5a8cdf28a866f8b152f4ffcc9d7d GIT binary patch literal 7001 zcmeHKX;hO}8m46|GezV~TV;^7MWrqfO%x1U+9FaaLM?-o62J-}Dod0IAq0qMI}9!$ zh(Op<^(ZP!ga{Z23F1N^A*oV@2n5tD2w_PAgg{846NiG^kns&3y8v(*7W*0Cf%W}`~1fG7{l(Tg=h~kt8;?isW+3rCjxEy;33=fsNV<3Z({t$u#k#Qfz_~w! zg5^x=da(WyxdyDqR<>XLueXQo$sZvoV!pa2dU=~DYo3Y13oGE|qc_8J4}hS_S3Sd`_))yoj5l=0v6 zF6Hh7;eqJI=h*ajH(4{C=B6el9hhiYfc}jYm-nTaU6J2~4Y;F6KMTDY$pH`HCto#* zaSzX~(akZal?4R_2@*CMUa*R{xddCtM{vE2h`%^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FsRfiVqaL>S1q z_3&fq*ZTLtdcOuNCX?I1@/jest.setup.ts"], + setupFilesAfterEnv: ["/jest/jest.setup.ts"], testPathIgnorePatterns: [ "/cypress/", "/.next/", diff --git a/jest.setup.ts b/jest.setup.ts deleted file mode 100644 index fb53a2c..0000000 --- a/jest.setup.ts +++ /dev/null @@ -1,4 +0,0 @@ -import "@testing-library/jest-dom"; -import { toMatchImageSnapshot } from "jest-image-snapshot"; - -expect.extend({ toMatchImageSnapshot }); diff --git a/jest/jest.setup.ts b/jest/jest.setup.ts new file mode 100644 index 0000000..e37e0cc --- /dev/null +++ b/jest/jest.setup.ts @@ -0,0 +1,10 @@ +import { expect } from "@jest/globals"; +import "@testing-library/jest-dom"; +import { configureToMatchImageSnapshot } from "jest-image-snapshot"; + +const toMatchImageSnapshot = configureToMatchImageSnapshot({ + customSnapshotsDir: "jest/snapshots/current_output", + customDiffDir: "jest/snapshots/diff_output", +}); + +expect.extend({ toMatchImageSnapshot }); diff --git a/src/components/welcome/__image_snapshots__/welcome-test-tsx-should-match-image-snapshot-1-snap.png b/jest/snapshots/current_output/welcome-test-tsx-should-match-image-snapshot-1-snap.png similarity index 100% rename from src/components/welcome/__image_snapshots__/welcome-test-tsx-should-match-image-snapshot-1-snap.png rename to jest/snapshots/current_output/welcome-test-tsx-should-match-image-snapshot-1-snap.png diff --git a/package-lock.json b/package-lock.json index 1d73064..c3a2f4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2411,6 +2411,105 @@ "picomatch": "^2.0.4" } }, + "app-path": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/app-path/-/app-path-3.3.0.tgz", + "integrity": "sha512-EAgEXkdcxH1cgEePOSsmUtw9ItPl0KTxnh/pj9ZbhvbKbij9x0oX6PWpGnorDr0DS5AosLgoa5n3T/hZmKQpYA==", + "dev": true, + "requires": { + "execa": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "arch": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", @@ -3590,6 +3689,162 @@ } } }, + "cypress-image-snapshot": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cypress-image-snapshot/-/cypress-image-snapshot-4.0.1.tgz", + "integrity": "sha512-PBpnhX/XItlx3/DAk5ozsXQHUi72exybBNH5Mpqj1DVmjq+S5Jd9WE5CRa4q5q0zuMZb2V2VpXHth6MjFpgj9Q==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "fs-extra": "^7.0.1", + "glob": "^7.1.3", + "jest-image-snapshot": "4.2.0", + "pkg-dir": "^3.0.0", + "term-img": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jest-image-snapshot": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/jest-image-snapshot/-/jest-image-snapshot-4.2.0.tgz", + "integrity": "sha512-6aAqv2wtfOgxiJeBayBCqHo1zX+A12SUNNzo7rIxiXh6W6xYVu8QyHWkada8HeRi+QUTHddp0O0Xa6kmQr+xbQ==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "get-stdin": "^5.0.1", + "glur": "^1.1.2", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "pixelmatch": "^5.1.0", + "pngjs": "^3.4.0", + "rimraf": "^2.6.2", + "ssim.js": "^3.1.1" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + } + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "damerau-levenshtein": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.7.tgz", @@ -5378,6 +5633,16 @@ "istanbul-lib-report": "^3.0.0" } }, + "iterm2-version": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/iterm2-version/-/iterm2-version-4.2.0.tgz", + "integrity": "sha512-IoiNVk4SMPu6uTcK+1nA5QaHNok2BMDLjSl5UomrOixe5g4GkylhPwuiGdw00ysSCrXAKNMfFTu+u/Lk5f6OLQ==", + "dev": true, + "requires": { + "app-path": "^3.2.0", + "plist": "^3.0.1" + } + }, "jest": { "version": "27.0.6", "resolved": "https://registry.npmjs.org/jest/-/jest-27.0.6.tgz", @@ -7500,6 +7765,12 @@ "watchpack": "2.1.1" } }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node-fetch": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", @@ -7841,6 +8112,12 @@ "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", "dev": true }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -8027,6 +8304,17 @@ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==" }, + "plist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", + "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", + "dev": true, + "requires": { + "base64-js": "^1.5.1", + "xmlbuilder": "^9.0.7", + "xmldom": "^0.5.0" + } + }, "pngjs": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", @@ -8947,6 +9235,12 @@ "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-final-newline": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", @@ -9075,6 +9369,16 @@ } } }, + "term-img": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/term-img/-/term-img-4.1.0.tgz", + "integrity": "sha512-DFpBhaF5j+2f7kheKFc1ajsAUUDGOaNPpKPtiIMxlbfud6mvfFZuWGnTRpaujUa5J7yl6cIw/h6nyr4mSsENPg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.1.0", + "iterm2-version": "^4.1.0" + } + }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -9588,12 +9892,24 @@ "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", "dev": true }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", + "dev": true + }, "xmlchars": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", "dev": true }, + "xmldom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", + "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==", + "dev": true + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 43dd5a1..85dc006 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@typescript-eslint/eslint-plugin": "^4.28.1", "@typescript-eslint/parser": "^4.28.0", "cypress": "^7.7.0", + "cypress-image-snapshot": "^4.0.1", "eslint": "^7.27.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-jsx-a11y": "^6.4.1", @@ -38,7 +39,7 @@ "build": "next build", "start": "next start", "test:jest": "jest", - "test:jest:update": "jest -- -u", + "test:jest:update": "jest --updateSnapshot", "test:cypress:open": "cypress open", "test:cypress:run": "cypress run", "test:cypress:run:update": "cypress run --env updateSnapshots=true",