Skip to content

Commit

Permalink
Merge pull request #434 from platanus/ci-fixes
Browse files Browse the repository at this point in the history
Ci fixes
  • Loading branch information
difernandez authored Apr 11, 2023
2 parents 0cdfbb0 + 695b6f4 commit d716820
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 23 deletions.
12 changes: 5 additions & 7 deletions lib/potassium/assets/.circleci/config.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:

- run:
name: POST extracted data to nest
command: bin/rake "repo_analyzer:analyze[platanus/<%= get(:app_name) %>]"
command: bin/rake "repo_analyzer:analyze[platanus/<%= get(:github_repo_name) || get(:dasherized_app_name) %>]"

- run:
name: Run simplecov
Expand All @@ -137,12 +137,10 @@ jobs:
RSPEC_FORMAT_ARGS="--tag type:system -f progress --no-color -p 10"
bundle exec rspec spec $RSPEC_FORMAT_ARGS $RSPEC_JUNIT_ARGS

- run:
name: Run vitest
command: |
yarn run test > coverage/input_vitest.txt
./node_modules/.bin/format-coverage coverage/input_vitest.txt coverage/output_vitest.txt /home/circleci/project/app/frontend
cat coverage/output_vitest.txt | ./bin/reviewdog -reporter=github-pr-review -efm="%f:%l:%c: %m"
- run:
name: Run vitest
command: |
yarn run test

- store_test_results:
path: test_results
Expand Down
4 changes: 2 additions & 2 deletions lib/potassium/assets/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"browser": true,
"es2021": true,
"node": true,
"jest/globals": true,
"vi": true,
"vue/setup-compiler-macros": true
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["import", "jest", "tailwindcss"],
"plugins": ["import", "tailwindcss"],
"settings": {
"import/resolver": {
"node": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const api = jest.fn();
const api = vi.fn();

export { api };
2 changes: 1 addition & 1 deletion lib/potassium/assets/tsconfig.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*", "playwright.config.*"],
"compilerOptions": {
"composite": true,
"types": ["node"]
"types": ["node", "vitest/globals"]
}
}
2 changes: 1 addition & 1 deletion lib/potassium/recipes/coverage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def install
end

def setup_coverage_dependencies
run "yarn add [email protected] c8 --dev"
run "yarn add c8 --dev"
end

private
Expand Down
6 changes: 3 additions & 3 deletions lib/potassium/recipes/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def add_linters

after(:vite_install) do
run "yarn add --dev stylelint eslint eslint-plugin-import "\
"@typescript-eslint/eslint-plugin @types/jest @typescript-eslint/parser "\
"eslint-plugin-jest eslint-plugin-platanus eslint-plugin-vue "\
"@vue/eslint-config-typescript eslint-plugin-tailwindcss"
"@typescript-eslint/eslint-plugin @typescript-eslint/parser "\
"eslint-plugin-platanus eslint-plugin-vue @vue/eslint-config-typescript "\
"eslint-plugin-tailwindcss"
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/potassium/templates/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
create :spring
create :readme
create :heroku
create :ci
create :style
create :puma
create :env
Expand Down Expand Up @@ -67,6 +66,7 @@
create :tzinfo
create :script
create :github
create :ci
create :cleanup
create :google_tag_manager
create :mjml
Expand Down
6 changes: 4 additions & 2 deletions spec/features/ci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
expect(ci_config).to include('cimg/ruby', 'cache', 'rspec', 'reviewdog')
end

it "adds repo analyzer config" do
expect(ci_config).to include('bin/rake "repo_analyzer:analyze[platanus/dummy_app]"')
it "uses dasherized app name for repo analyzer" do
expect(ci_config).to include(
"repo_analyzer:analyze[platanus/#{PotassiumTestHelpers::APP_NAME.dasherize}]"
)
end
end
4 changes: 0 additions & 4 deletions spec/features/coverage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,5 @@
it "adds vitest coverage configuration" do
expect(vite_config).to include("provider: 'c8',")
end

it "adds jest text formatter package" do
expect(node_modules_file).to include('jest-text-formatter')
end
end
end
2 changes: 1 addition & 1 deletion spec/front_end_vite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def read_file(file_path)
end

it 'includes mock example' do
expect(mock_example_file).to include('jest.fn()')
expect(mock_example_file).to include('vi.fn()')
end

it 'includes the dotenv monkeypatch' do
Expand Down

0 comments on commit d716820

Please sign in to comment.