feat: Use vitest instead of jest, run all the specs anywhere in app/ folder in the CI (#9722)
Due to the pattern `**/specs/*.spec.js` defined in CircleCI, none of the frontend spec in the folders such as `specs/<domain-name>/getters.spec.js` were not executed in Circle CI. This PR fixes the issue, along with the following changes: - Use vitest instead of jest - Remove jest dependancies - Update tests to work with vitest --------- Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
42
vite.config.ts
Normal file
42
vite.config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import path from 'path';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import Vue2 from '@vitejs/plugin-vue2';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [Vue2()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
include: ['app/**/*.{test,spec}.?(c|m)[jt]s?(x)'],
|
||||
coverage: {
|
||||
reporter: ['lcov', 'text'],
|
||||
include: ['app/**/*.js', 'app/**/*.vue'],
|
||||
exclude: [
|
||||
'app/**/*.@(spec|stories|routes).js',
|
||||
'**/specs/**/*',
|
||||
'**/i18n/**/*',
|
||||
],
|
||||
},
|
||||
globals: true,
|
||||
outputFile: 'coverage/sonar-report.xml',
|
||||
server: {
|
||||
deps: {
|
||||
inline: ['tinykeys', '@material/mwc-icon'],
|
||||
},
|
||||
},
|
||||
setupFiles: ['fake-indexeddb/auto'],
|
||||
mockReset: true,
|
||||
clearMocks: true,
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
dashboard: path.resolve('./app/javascript/dashboard'),
|
||||
widget: path.resolve('./app/javascript/widget'),
|
||||
survey: path.resolve('./app/javascript/survey'),
|
||||
assets: path.resolve('./app/javascript/dashboard/assets'),
|
||||
components: path.resolve('./app/javascript/dashboard/components'),
|
||||
helpers: path.resolve('./app/javascript/shared/helpers'),
|
||||
v3: path.resolve('./app/javascript/v3'),
|
||||
shared: path.resolve('./app/javascript/shared'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user