Skip to content

Commit c856e88

Browse files
authored
switch to vitest for js testing (#1386)
1 parent 23df7a6 commit c856e88

13 files changed

Lines changed: 1541 additions & 570 deletions

File tree

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
name: Stylelint
7878
command: pnpm stylelint
7979

80+
- run:
81+
name: Vitest
82+
command: pnpm vitest run --coverage
83+
8084
- run:
8185
name: Verify Stylelint Autogen
8286
command: bundle exec exe/stylelint_autogen

config/routes.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,4 @@
3838
get "/starred", to: "stories#starred"
3939
put "/stories/:id", to: "stories#update"
4040
post "/stories/mark_all_as_read", to: "stories#mark_all_as_read"
41-
42-
unless Rails.env.production?
43-
require_relative "../spec/javascript/test_controller"
44-
45-
get "/test", to: "test#index"
46-
get "/spec/*splat", to: "test#spec"
47-
get "/vendor/js/*splat", to: "test#vendor"
48-
get "/vendor/css/*splat", to: "test#vendor"
49-
end
5041
end

eslint.config.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,8 @@ export default [
2323
{
2424
files: ["spec/javascript/spec/**"],
2525
languageOptions: {
26+
sourceType: "module",
2627
globals: {
27-
describe: "readonly",
28-
it: "readonly",
29-
before: "readonly",
30-
beforeEach: "readonly",
31-
afterEach: "readonly",
32-
sinon: "readonly",
33-
chai: "readonly",
34-
mocha: "readonly",
35-
initMochaPhantomJS: "readonly",
3628
Story: "readonly",
3729
StoryView: "readonly",
3830
StoryList: "readonly",

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"private": true,
33
"scripts": {
44
"eslint": "eslint app/assets/javascripts/ spec/javascript/spec/",
5-
"stylelint": "stylelint 'app/assets/stylesheets/**/*.css'"
5+
"stylelint": "stylelint 'app/assets/stylesheets/**/*.css'",
6+
"test": "vitest run --coverage"
67
},
78
"dependencies": {
89
"@fontsource/lato": "^5.2.7",
@@ -17,18 +18,15 @@
1718
},
1819
"devDependencies": {
1920
"@eslint/js": "^9.21.0",
20-
"chai": "1.6.0",
21-
"chai-backbone": "0.9.4",
22-
"chai-changes": "1.3.6",
21+
"@vitest/coverage-v8": "4.0.18",
2322
"eslint": "^9.21.0",
2423
"globals": "^16.0.0",
25-
"mocha": "3.5.0",
26-
"sinon": "1.7.1",
27-
"sinon-chai": "2.14.0",
24+
"jsdom": "^28.0.0",
2825
"stylelint": "^17.3.0",
2926
"stylelint-config-recess-order": "^7.6.1",
3027
"stylelint-config-standard": "^40.0.0",
31-
"stylelint-selector-bem-pattern": "^4.0.1"
28+
"stylelint-selector-bem-pattern": "^4.0.1",
29+
"vitest": "^4.0.18"
3230
},
3331
"packageManager": "pnpm@10.4.1"
3432
}

0 commit comments

Comments
 (0)