From aa07bd20e8f4ae7186d297c42183ff3f7138a3a4 Mon Sep 17 00:00:00 2001 From: Tiberiu Ichim Date: Wed, 4 Aug 2021 23:59:00 +0300 Subject: [PATCH] WIP on addon testing --- Makefile | 11 ++++++++++- jest-addon.config.js | 4 ++++ package.json | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a2dabc6..9fd3bf8 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,12 @@ GREEN=`tput setaf 2` RESET=`tput sgr0` YELLOW=`tput setaf 3` +# HAS_YO=$(shell command yo) +# if [[ ${HAS_YO} -ne 0 ]]; then +# echo "Installing yo" +# npm install -g yo +# fi; + make-frontend: ## Builds just the Volto project npm install -g yo npm install -g @plone/generator-volto @@ -17,7 +23,10 @@ make-frontend: ## Builds just the Volto project yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive ln -sf $$(pwd) project/src/addons/ cp .project.eslintrc.js .eslintrc.js - cd project && yarn + cd project && \ + rm -rf node_modules && \ + yalc add @plone/volto --no-pure && \ + pnpm i @echo "-------------------" @echo "Project is ready!" @echo "Now run: cd project && yarn start" diff --git a/jest-addon.config.js b/jest-addon.config.js index 7c15499..ef69d3c 100644 --- a/jest-addon.config.js +++ b/jest-addon.config.js @@ -33,4 +33,8 @@ module.exports = { statements: 5, }, }, + haste: { + enableSymlinks: true, + }, + "watchman": false, }; diff --git a/package.json b/package.json index 71b25bf..02ab5cd 100644 --- a/package.json +++ b/package.json @@ -38,5 +38,9 @@ "lint:fix": "../../../node_modules/eslint/bin/eslint.js --max-warnings=0 --fix 'src/**/*.{js,jsx}'", "cypress:run": "../../../node_modules/cypress/bin/cypress run", "cypress:open": "../../../node_modules/cypress/bin/cypress open" + }, + "jest": { + "enableSymlinks": true } + }