mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
chore(front): make unit-testing cross-platform
Signed-off-by: Grigorii Shartsev <grigorii.shartsev@nextcloud.com>
This commit is contained in:
parent
53f8ce5eee
commit
c39f69b41e
4 changed files with 35 additions and 9 deletions
|
|
@ -20,6 +20,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
const { resolve } = require('node:path')
|
||||
|
||||
// TODO: find a way to consolidate this in one place, with webpack.common.js
|
||||
const ignorePatterns = [
|
||||
'(vue-material-design-icons)',
|
||||
|
|
@ -64,6 +66,8 @@ module.exports = {
|
|||
'<rootDir>/src/test-setup.js',
|
||||
'jest-mock-console/dist/setupTestFramework.js',
|
||||
],
|
||||
globalSetup: resolve(__dirname, 'jest.global.setup.js'),
|
||||
|
||||
collectCoverageFrom: [
|
||||
'<rootDir>/src/**/*.{js,vue}',
|
||||
],
|
||||
|
|
@ -76,14 +80,13 @@ module.exports = {
|
|||
],
|
||||
|
||||
moduleNameMapper: {
|
||||
'\\.(css|scss)$': '<rootDir>/src/__mocks__/styles.js',
|
||||
'vendor/tflite/(.*).wasm$': '<rootDir>/src/utils/media/effects/virtual-background/vendor/tflite/$1.js',
|
||||
},
|
||||
|
||||
transform: {
|
||||
// process `*.js` files with `babel-jest`
|
||||
'.*\\.(js)$': 'babel-jest',
|
||||
'^.+\\.vue$': '@vue/vue2-jest',
|
||||
'src/utils/media/effects/virtual-background/vendor/*': 'jest-transform-stub',
|
||||
'\\.js$': 'babel-jest',
|
||||
'\\.vue$': '@vue/vue2-jest',
|
||||
'\\.tflite$': 'jest-transform-stub',
|
||||
'\\.(css|scss)$': 'jest-transform-stub',
|
||||
},
|
||||
}
|
||||
|
|
|
|||
24
jest.global.setup.js
Normal file
24
jest.global.setup.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* @copyright Copyright (c) 2023 Grigorii Shartsev <me@shgk.me>
|
||||
*
|
||||
* @author Grigorii Shartsev <me@shgk.me>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
module.exports = () => {
|
||||
process.env.TZ = 'UTC'
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
"dev": "webpack --node-env development --progress",
|
||||
"watch": "webpack --node-env development --progress --watch",
|
||||
"serve": "webpack serve --node-env development --progress --allowed-hosts all",
|
||||
"test": "TZ=UTC jest",
|
||||
"test:watch": "TZ=UTC jest --watch",
|
||||
"test:coverage": "TZ=UTC jest --coverage",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"lint": "eslint --ext .js,.vue src",
|
||||
"lint:fix": "eslint --ext .js,.vue src --fix",
|
||||
"stylelint": "stylelint css/*.css css/*.scss src/**/*.scss src/**/*.vue",
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
module.exports = {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue