Ocelot-Social/webapp/jest.config.js
Max 1e6a74b8ce
feat(frontend): observe posts (#8293)
* After creating the post, the author of it automatically observes it to get notifications when there are interactions

* a user that comments a post, automatically observes that post to get notifications when there are more interactions on that post

* mutation that switches the state of the obeservation of a post on and off

* remove duplicate code

* fix unit tests

* add metric observed users count to posts

* change naming

* Add follow post entry to post menu

* Add FollowButton (WIP), show unfollow in menu when already followed

* Follow/unfollow post => observe

* Update slashed bell

* Add requests to observe/unobserve posts

* Add ObserveButton functionality

* Rename isObservedByMe

* Add observingUsersCount; simplify ObserveButton and menu entries

* Fix locales

* Add snapshot test for ObserveButton (WIP)

* Remove empty routes push

* Add test for ObserveButton

* Add test for ContentMenu, improve ObserveButton test

* Remove unneeded fields from PostQuery

---------

Co-authored-by: Moriz Wahl <moriz.wahl@gmx.de>
2025-04-04 11:54:43 +00:00

43 lines
1.2 KiB
JavaScript

module.exports = {
verbose: true,
collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,vue}',
'!**/?(*.)+(spec|test|story).js?(x)',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/storybook/**',
'!**/coverage/**',
'!**/config/**',
'!**/maintenance/**',
'!**/plugins/**',
'!**/.eslintrc.js',
'!**/.prettierrc.js',
'!**/nuxt.config.js',
],
coverageThreshold: {
global: {
lines: 83,
},
},
coverageProvider: 'v8',
setupFiles: ['<rootDir>/test/registerContext.js', '<rootDir>/test/testSetup.js'],
transform: {
'.*\\.(vue)$': '@vue/vue2-jest',
'^.+\\.js$': 'babel-jest',
},
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleNameMapper: {
'\\.(svg)$': '<rootDir>/test/fileMock.js',
'\\.(scss|css|less)$': 'identity-obj-proxy',
'@mapbox/mapbox-gl-geocoder': 'identity-obj-proxy',
'vue2-datepicker/locale/undefined': 'vue2-datepicker/locale/en',
'^@/(.*)$': '<rootDir>/src/$1',
'^~/(.*)$': '<rootDir>/$1',
},
moduleFileExtensions: ['js', 'json', 'vue'],
testEnvironment: 'jest-environment-jsdom',
snapshotSerializers: ['jest-serializer-vue'],
}