Skip to content

Commit

Permalink
Add monaco-promql to transform
Browse files Browse the repository at this point in the history
  • Loading branch information
idastambuk committed Dec 10, 2024
1 parent 1e37f24 commit 44c0a2e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
24 changes: 12 additions & 12 deletions jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import { matchers } from './src/matchers';
expect.extend(matchers);

window.MessageChannel = jest.fn().mockImplementation(() => {
let onmessage;
return {
port1: {
set onmessage(cb) {
onmessage = cb;
},
let onmessage;
return {
port1: {
set onmessage(cb) {
onmessage = cb;
},
port2: {
postMessage: data => {
onmessage?.({ data });
},
},
port2: {
postMessage: (data) => {
onmessage?.({ data });
},
};
});
},
};
});
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// force timezone to UTC to allow tests to work regardless of local timezone
// generally used by snapshots, but can affect specific tests
process.env.TZ = 'UTC';
const { grafanaESModules, nodeModulesToTransform } = require('./.config/jest/utils');

module.exports = {
// Jest configuration provided by Grafana scaffolding
// Jest configuration provided by @grafana/create-plugin
...require('./.config/jest.config'),
// Inform Jest to only transform specific node_module packages.
transformIgnorePatterns: [nodeModulesToTransform([...grafanaESModules, 'monaco-promql'])],
};

0 comments on commit 44c0a2e

Please sign in to comment.