diff --git a/.config/jest.config.js b/.config/jest.config.js index 7ef91efc..1528f9c2 100755 --- a/.config/jest.config.js +++ b/.config/jest.config.js @@ -9,7 +9,6 @@ module.exports = { testMatch: [ '/src/**/__tests__/**/*.{js,jsx,ts,tsx}', '/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', - '/src/**/*.{spec,test,jest}.{js,jsx,ts,tsx}', ], transform: { '^.+\\.(t|j)sx?$': [ @@ -28,7 +27,4 @@ module.exports = { ], }, setupFilesAfterEnv: ['/jest-setup.ts'], - transformIgnorePatterns: [ - "!node_modules/d3-interpolate" - ] }; diff --git a/jest.config.js b/jest.config.js index df0af6bd..8576ca08 100755 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { // Jest configuration provided by Grafana scaffolding ...require('./.config/jest.config'), testTimeout: 300000, - "transformIgnorePatterns": [ - "node_modules/(?!monaco-promql/)" - ] + transformIgnorePatterns: [ + "node_modules/(?!(d3-color|d3-interpolate|monaco-promql|ol)/)" + ], }; diff --git a/src/querybuilder/parsing.ts b/src/querybuilder/parsing.ts index 52113e24..68c6f1d0 100755 --- a/src/querybuilder/parsing.ts +++ b/src/querybuilder/parsing.ts @@ -206,7 +206,7 @@ function handleFunction(expr: string, node: SyntaxNode, context: Context) { // the query model. // - it is easier to handle template variables this way as template variable is an error for the parser if (rangeFunctions.includes(funcName) || funcName.endsWith('_over_time')) { - let match = getString(expr, node).match(/\[(.+)\]/); + let match = getString(expr, node).match(/(?