Skip to content

Commit

Permalink
Merge pull request #408 from platanus/fix-jest
Browse files Browse the repository at this point in the history
fix(front-end): fix jest install
  • Loading branch information
gmq authored Aug 18, 2022
2 parents e9d10cc + 87bdff0 commit 4fbb9f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions lib/potassium/recipes/front_end.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Recipes::FrontEnd < Rails::AppBuilder
POSTCSS_VERSION = Potassium::POSTCSS_VERSION
TAILWINDCSS_VERSION = Potassium::TAILWINDCSS_VERSION
AUTOPREFIXER_VERSION = Potassium::AUTOPREFIXER_VERSION
VUE_JEST_VERSION = Potassium::VUE_JEST_VERSION
JEST_VERSION = Potassium::JEST_VERSION

def ask
frameworks = {
Expand Down Expand Up @@ -107,8 +107,10 @@ def setup_tailwind
end

def setup_jest
run "bin/yarn add jest @vue/vue3-jest@#{VUE_JEST_VERSION} babel-jest "\
"@vue/test-utils@#{VUE_TEST_UTILS_VERSION} ts-jest"
run "bin/yarn add jest@#{JEST_VERSION} @vue/vue3-jest@#{JEST_VERSION} "\
"babel-jest@#{JEST_VERSION} @vue/test-utils@#{VUE_TEST_UTILS_VERSION} ts-jest@#{JEST_VERSION} "\
"jest-environment-jsdom@#{JEST_VERSION} --dev"
run "bin/yarn add @types/jest@#{JEST_VERSION}"
json_file = File.read(Pathname.new("package.json"))
js_package = JSON.parse(json_file)
js_package = js_package.merge(jest_config)
Expand Down Expand Up @@ -240,6 +242,9 @@ def jest_config
"moduleNameMapper": {
"^@/(.*)$": "app/javascript/$1"
},
"testEnvironmentOptions": {
"customExportConditions": ["node", "node-addons"]
},
"moduleFileExtensions": [
"js",
"ts",
Expand Down
8 changes: 4 additions & 4 deletions lib/potassium/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module Potassium
TAILWINDCSS_VERSION = "^3"
POSTCSS_VERSION = "^8"
AUTOPREFIXER_VERSION = "^10"
VUE_VERSION = "^3"
VUE_LOADER_VERSION = "^16"
VUE_TEST_UTILS_VERSION = "^2.0.0-rc.18"
VUE_JEST_VERSION = "^27.0.0-alpha.1"
VUE_VERSION = "^3.2.33"
VUE_LOADER_VERSION = "^16.8.3"
VUE_TEST_UTILS_VERSION = "^2.0.2"
JEST_VERSION = "^28.0.1"
end

0 comments on commit 4fbb9f6

Please sign in to comment.