chore: require Node.js 24.15 or later and switch the shared IDE test configs from Jest to Vitest (#6676)

This commit is contained in:
Peter Evans authored and GitHub committed 2026-11-16 10:58:21 +00:00
1 parent 7ecc6f063b
commit 4dcceef1d6
26 files changed
+49 -395

No files matched your search

@@ -1,10 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="true" type="JavaScriptTestRunnerJest">
<configuration default="true" type="JavaScriptTestRunnerVitest">
<node-interpreter value="project" />
<node-options value="" />
<vitest-package value="$PROJECT_DIR$/web-frontend/node_modules/vitest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="error.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/core/components/error.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="events.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/core/utils/events.spec.js" />
<method v="2" />
</configuration>
</component>
-13
View File
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="grid.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/database/store/view/grid.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="importer.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/database/mixins/importer.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="index.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/server/jest.config.js" />
<node-interpreter value="$USER_HOME$/.nvm/versions/node/v14.16.0/bin/node" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/server/core/pages/index.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="login.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/server/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/server/core/pages/login.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="object.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/core/utils/object.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="passwordInput.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/core/components/passwordInput.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="signup.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/server/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/server/core/pages/signup.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="string.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/core/utils/string.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="table.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend/" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/database/table.spec.js" />
<method v="2" />
</configuration>
</component>
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="viewFilters.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend/" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/database/viewFilters.spec.js" />
<method v="2" />
</configuration>
</component>
-13
View File
@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="xml.spec.js" type="JavaScriptTestRunnerJest" nameIsGenerated="true">
<config-file value="$PROJECT_DIR$/web-frontend/test/unit/jest.config.js" />
<node-interpreter value="project" />
<node-options value="" />
<jest-package value="$PROJECT_DIR$/web-frontend/node_modules/jest" />
<working-dir value="$PROJECT_DIR$/web-frontend" />
<envs />
<scope-kind value="TEST_FILE" />
<test-file value="$PROJECT_DIR$/web-frontend/test/unit/database/utils/xml.spec.js" />
<method v="2" />
</configuration>
</component>
+19 -21
View File
@@ -58,41 +58,39 @@
},
},
{
"name": "vscode-jest-current-file",
// Core (web-frontend) tests only. Premium and enterprise tests use their
// own Vitest config: run or debug them from the Vitest extension instead.
"name": "vitest: current core test file",
"type": "node",
"runtimeVersion": "16.15.0",
"runtimeVersion": "24",
"request": "launch",
"cwd": "${workspaceFolder}/web-frontend",
"program": "./node_modules/jest/bin/jest",
"args": [
"${fileBasename}",
"--verbose",
"-i",
"--no-cache"
],
"program": "${workspaceFolder}/web-frontend/node_modules/vitest/vitest.mjs",
"args": ["run", "${file}", "--no-file-parallelism"],
"env": {
"PRIVATE_BACKEND_URL": "http://localhost:8000"
"NODE_OPTIONS": "--max-old-space-size=8192"
},
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "vscode-jest-tests",
"name": "vitest: all core tests",
"type": "node",
"runtimeVersion": "16.15.0",
"runtimeVersion": "24",
"request": "launch",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"cwd": "${workspaceFolder}/web-frontend",
"program": "node_modules/.bin/jest",
"args": [
"--config=jest.config.js",
"--runInBand",
"--watchAll=false",
],
"program": "${workspaceFolder}/web-frontend/node_modules/vitest/vitest.mjs",
"args": ["run"],
"env": {
"PRIVATE_BACKEND_URL": "http://localhost:8000"
"NODE_OPTIONS": "--max-old-space-size=8192"
},
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**", "**/node_modules/**"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
]
}
+1 -4
View File
@@ -3,10 +3,7 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["backend"],
"jest.autoRun": "off",
"jest.rootPath": "web-frontend",
"jest.jestCommandLine": "node_modules/.bin/jest --config jest.config.js --runInBand --watchAll=false",
"coverage-gutters.coverageBaseDir": "**/*coverage",
"vitest.configSearchPatternExclude": "{**/node_modules/**,**/vendor/**,**/.*/**,**/*.d.ts,**/vitest.config.base.ts}", "coverage-gutters.coverageBaseDir": "**/*coverage",
"coverage-gutters.showLineCoverage": true,
"sqltools.connections": [
{
+1 -1
View File
@@ -8,7 +8,7 @@ ms-python.python
ms-python.vscode-pylance
mtxr.sqltools
mtxr.sqltools-driver-pg
Orta.vscode-jest
vitest.explorer
ryanluker.vscode-coverage-gutters
sibiraj-s.vscode-scss-formatter
stylelint.vscode-stylelint
+1 -1
View File
@@ -84,12 +84,12 @@ web frontend. This whole directory is also added to the web-frontend container.
`--target dev` to instead get a dev ready image.
* `intellij-idea.webpack.config.js` a webpack config file that can be used by Intellij
iDEA. It adds the correct aliases for the editor.
* `jest.config.js`: config file for running the tests with JEST.
* `justfile`: contains commands to install dependencies, run the linter, and run
the tests.
* `nuxt.config.js`: base Nuxt config for the development environment.
* `package.json`: main package config including all the dependencies for the
web-frontend.
* `vitest.config.ts`: config file for running the tests with Vitest.
* `yarn.lock`: auto generated file containing a list of the dependencies installed via
yarn.
@@ -35,7 +35,7 @@ This guide covers running Baserow's backend and frontend natively on your machin
curl -LsSf https://astral.sh/uv/install.sh | sh
```
5. **Node.js 24** - For the frontend
5. **Node.js 24.15 or later (24.x)** - For the frontend
```bash
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
@@ -45,6 +45,10 @@ This guide covers running Baserow's backend and frontend natively on your machin
# macOS with Homebrew
brew install node@24
```
Older 24.x versions fail `yarn install` with `The engine "node" is incompatible
with this module`; run `nvm install 24` again (or `brew upgrade node@24`) to get
the latest 24.x. nvm keeps global packages per Node version, so run
`npm install -g yarn` again after switching.
6. **Yarn** - Frontend package manager
```bash
npm install -g yarn
@@ -169,7 +173,7 @@ just shell_plus
```bash
# From project root (just f is shorthand for just frontend)
just f lint # Run ESLint + Stylelint
just f test # Run Jest tests
just f test # Run Vitest tests
just f fix # Auto-fix code style
# From web-frontend/
@@ -281,8 +285,8 @@ just test-db stop
### Frontend Tests
```bash
just f test # Run Jest tests
just f test --watch # Watch mode
just f test # Run Vitest tests
just f yarn test:core # Watch mode (core tests; also test:premium, test:enterprise)
```
## Database Operations
+5 -6
View File
@@ -154,18 +154,17 @@ https://webpack.js.org/
https://sass-lang.com/
### JEST
### Vitest
Because of its simplicity and compatibility with Vue and Nuxt we have chosen to include
JEST as the framework for the web frontend tests. Almost no code is covered yet so we
can definitely improve on that. The code is also tested in the continuous integration
pipeline. It can also be tested manually:
We use Vitest, with `@nuxt/test-utils`, as the framework for the web frontend tests.
The code is also tested in the continuous integration pipeline. It can also be tested
manually:
```bash
just f test
```
https://jestjs.io/
https://vitest.dev/
### Iconoir
+10 -9
View File
@@ -53,17 +53,18 @@ Install the following tools:
run `backend/tests/baserow/core/test_core_models.py` for instance.
1. Now lets set up your frontend dev by changing directory to `baserow/web-frontend`
1. Use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install the correct version of `node`.
To determine the version of Node.js to use, see the `runtimeVersion` inside the
`launch.json` file. E.g. if the version is `v16.15.0`, you can install it with:
`nvm install v16.15.0` and then enable it with `nvm use v16.15.0`. Alternatively,
see `baserow/docs/installation/supported.md` to determine the supported version
of Node.js to use.
You need Node.js 24.15 or later in the 24.x line: install it with `nvm install 24`
and enable it with `nvm use 24`. Older 24.x versions fail `yarn install` with
`The engine "node" is incompatible with this module`; run `nvm install 24` again to
get the latest 24.x, then `npm install -g yarn` again (nvm keeps global packages
per Node version). See `baserow/docs/installation/supported.md` for the supported
versions of Node.js.
1. Install `yarn` globally: `npm install -g yarn`
1. Now run `just f install` to install dependencies (or `yarn install` directly).
1. Select "Trust Project" if you see an VSCode popup after running yarn install
1. If you do not see Jest tests in the testing menu:
1. Type: Ctrl + Shift + P or open the command palette
1. Type: Jest: Start All Runners
1. Install the [Vitest extension](https://marketplace.visualstudio.com/items?itemName=vitest.explorer)
(`vitest.explorer`). It finds the core, premium and enterprise Vitest configs and
lists their tests in the testing menu.
1. Confirm you can run a web-frontend unit test from vscode
# Recommended Plugins
@@ -76,7 +77,7 @@ Otherwise, you can manually install:
1. Eslint
1. Gitlab Workflow
1. Gitlens
1. Jest
1. Vitest
1. SCSS Formatter
1. Stylelint
1. Mypy
+1 -1
View File
@@ -17,7 +17,7 @@ Software versions are divided into the following groups:
| Chrome | Latest | Latest | Latest |
| Edge | Latest | Latest | Latest |
| Python | >=3.14.0 | 3.14.8 | latest 3.14.x |
| Node.js | >= 24.0.0 | 24.22.1 | >= 24.0.0 |
| Node.js | >= 24.15.0 | 24.22.1 | latest 24.x |
| Docker | >= 19.03 | Latest | Latest |
| docker-compose | >= 1.19.0 | Latest | Latest |
| PostgreSQL | >= 14 | 14 | 15+ |
-61
View File
@@ -1,61 +0,0 @@
const path = require('path')
module.exports = {
displayName: 'enterprise-unit',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/test/unit/**/*.spec.js'],
moduleFileExtensions: ['js', 'json', 'vue', '.mjs'],
moduleDirectories: [
path.join(__dirname, '/../../web-frontend/node_modules/'),
],
modulePaths: [path.join(__dirname, '/../../web-frontend/node_modules/')],
moduleNameMapper: {
'^@baserow/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^@baserow_premium/(.*)$': path.join(
__dirname,
'/../../premium/web-frontend/modules/baserow_premium/$1'
),
'^@baserow_premium_test/(.*)$': path.join(
__dirname,
'/../../../premium/web-frontend/test/$1'
),
'^@/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^~/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^vue$': path.join(
__dirname,
'/../../web-frontend/node_modules/vue/dist/vue.common.js'
),
},
transform: {
'^.+\\.(mjs|js)$': [
'babel-jest',
{
configFile: path.join(__dirname, '/../../web-frontend/babel.config.js'),
},
],
'^.+\\.vue$': '../../web-frontend/node_modules/@vue/vue2-jest',
'^.+\\.(gif|ico|jpg|jpeg|png|svg)$':
'../../web-frontend/test/helpers/stubFileTransformer.js',
},
setupFilesAfterEnv: [
path.join(__dirname, '/../../enterprise/web-frontend/jest.setup.js'),
],
snapshotSerializers: [
path.join(
__dirname,
'/../../web-frontend/node_modules/jest-serializer-vue'
),
],
coverageReporters: [
'text-summary',
['cobertura', { projectRoot: '/baserow/' }],
],
collectCoverageFrom: [
'**/*.{js,Vue,vue}',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/reports/**',
'!**/test/**',
'!**/generated/**',
],
}
-65
View File
@@ -1,65 +0,0 @@
const path = require('path')
module.exports = {
displayName: 'premium-unit',
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/test/unit/**/*.spec.js'],
moduleFileExtensions: ['js', 'json', 'vue', '.mjs'],
moduleDirectories: [
path.join(__dirname, '/../../web-frontend/node_modules/'),
],
modulePaths: [path.join(__dirname, '/../../web-frontend/node_modules/')],
moduleNameMapper: {
'^@baserow/(.*).(scss|sass)$': path.join(
__dirname,
'/../../web-frontend/test/helpers/scss.js'
),
'^@baserow/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^@baserow_premium/(.*)$': path.join(
__dirname,
'/../../premium/web-frontend/modules/baserow_premium/$1'
),
'^@baserow_premium_test/(.*)$': path.join(
__dirname,
'/../../premium/web-frontend/test/$1'
),
'^@/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^~/(.*)$': path.join(__dirname, '/../../web-frontend/$1'),
'^vue$': path.join(
__dirname,
'/../../web-frontend/node_modules/vue/dist/vue.common.js'
),
},
transform: {
'^.+\\.(mjs|js)$': [
'babel-jest',
{
configFile: path.join(__dirname, '/../../web-frontend/babel.config.js'),
},
],
'^.+\\.vue$': '../../web-frontend/node_modules/@vue/vue2-jest',
'^.+\\.(gif|ico|jpg|jpeg|png|svg)$':
'../../web-frontend/test/helpers/stubFileTransformer.js',
},
setupFilesAfterEnv: [
path.join(__dirname, '/../../premium/web-frontend/jest.setup.js'),
],
snapshotSerializers: [
path.join(
__dirname,
'/../../web-frontend/node_modules/jest-serializer-vue'
),
],
coverageReporters: [
'text-summary',
['cobertura', { projectRoot: '/baserow/' }],
],
collectCoverageFrom: [
'**/*.{js,Vue,vue}',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/reports/**',
'!**/test/**',
'!**/generated/**',
],
}
-25
View File
@@ -1,25 +0,0 @@
const path = require('path')
// Setting reporters on the command line does not work so enable via this env variable
// we have to set anyway when using the junit reporter in CI.
const junitReporterConfig = process.env.JEST_JUNIT_OUTPUT_DIR
? {
reporters: ['default', path.join(__dirname, '/node_modules/jest-junit')],
}
: {}
module.exports = {
coverageReporters: [
'text-summary',
['cobertura', { projectRoot: '/baserow/' }],
],
collectCoverageFrom: [
'<rootDir>/modules/**/*.{js,Vue,vue}',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/reports/**',
'!**/test/**',
'!**/generated/**',
],
...junitReporterConfig,
}
-26
View File
@@ -1,26 +0,0 @@
const coverageConfig = require('./coverage.config.js')
const path = require('path')
module.exports = {
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/test/unit/**/*.spec.js'],
moduleFileExtensions: ['js', 'json', 'vue', '.mjs'],
moduleNameMapper: {
'^@baserow/(.*).(scss|sass)$': '<rootDir>/test/helpers/scss.js',
'^@baserow/(.*)$': '<rootDir>/$1',
'^@baserow_test_cases/(.*)$': path.join(__dirname, '../tests/cases/$1'),
'^@/(.*)$': '<rootDir>/$1',
'^~/(.*)$': '<rootDir>/$1',
'^vue$': '<rootDir>/node_modules/vue/dist/vue.common.js',
},
transform: {
'^.+\\.(mjs|js)$': 'babel-jest',
'^.+\\.vue$': '@vue/vue2-jest',
'^.+\\.(gif|ico|jpg|jpeg|png|svg)$':
'<rootDir>/test/helpers/stubFileTransformer.js',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
cacheDirectory: '<rootDir>/.cache/jest',
...coverageConfig,
}