Skip to content

Commit

Permalink
fix(front-end): fix jest install
Browse files Browse the repository at this point in the history
  • Loading branch information
gmq committed Jul 8, 2022
1 parent a972f90 commit 3d833a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 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,9 @@ 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"
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 @@ -239,6 +240,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 3d833a8

Please sign in to comment.