Bumps [`@grafana/create-plugin`](https://github.com/grafana/plugin-tools/tree/main/packages/create-plugin) configuration from 4.2.1 to 5.26.4. **Notes for reviewer:** This is an auto-generated PR which ran `@grafana/create-plugin update`. Please consult the create-plugin [CHANGELOG.md](https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/CHANGELOG.md) to understand what may have changed. Please review the changes thoroughly before merging. --------- Co-authored-by: grafana-plugins-platform-bot[bot] <144369747+grafana-plugins-platform-bot[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
45 lines
1.5 KiB
JavaScript
45 lines
1.5 KiB
JavaScript
/*
|
|
* ⚠️⚠️⚠️ THIS FILE WAS SCAFFOLDED BY `@grafana/create-plugin`. DO NOT EDIT THIS FILE DIRECTLY. ⚠️⚠️⚠️
|
|
*
|
|
* In order to extend the configuration follow the steps in
|
|
* https://grafana.com/developers/plugin-tools/how-to-guides/extend-configurations#extend-the-jest-config
|
|
*/
|
|
|
|
const path = require('path');
|
|
const { grafanaESModules, nodeModulesToTransform } = require('./jest/utils');
|
|
|
|
module.exports = {
|
|
moduleNameMapper: {
|
|
'\\.(css|scss|sass)$': 'identity-obj-proxy',
|
|
'react-inlinesvg': path.resolve(__dirname, 'jest', 'mocks', 'react-inlinesvg.tsx'),
|
|
},
|
|
modulePaths: ['<rootDir>/src'],
|
|
setupFilesAfterEnv: ['<rootDir>/jest-setup.js'],
|
|
testEnvironment: 'jest-environment-jsdom',
|
|
testMatch: [
|
|
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}',
|
|
'<rootDir>/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}',
|
|
],
|
|
transform: {
|
|
'^.+\\.(t|j)sx?$': [
|
|
'@swc/jest',
|
|
{
|
|
sourceMaps: 'inline',
|
|
jsc: {
|
|
parser: {
|
|
syntax: 'typescript',
|
|
tsx: true,
|
|
decorators: false,
|
|
dynamicImport: true,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
// Jest will throw `Cannot use import statement outside module` if it tries to load an
|
|
// ES module without it being transformed first. ./config/README.md#esm-errors-with-jest
|
|
transformIgnorePatterns: [nodeModulesToTransform(grafanaESModules)],
|
|
watchPathIgnorePatterns: ['<rootDir>/node_modules', '<rootDir>/dist'],
|
|
};
|