fix tests and types generator (#4746)
# What this PR does Fix unit tests from irm run Fix types generator after Node.js upgrade ## Which issue(s) this PR closes Related to https://github.com/grafana/irm/issues/25 <!-- *Note*: If you want the issue to be auto-closed once the PR is merged, change "Related to" to "Closes" in the line above. If you have more than one GitHub issue that this PR closes, be sure to preface each issue link with a [closing keyword](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue). This ensures that the issue(s) are auto-closed once the PR has been merged. --> ## Checklist - [ ] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] Added the relevant release notes label (see labels prefixed w/ `release:`). These labels dictate how your PR will show up in the autogenerated release notes.
This commit is contained in:
parent
0aa3b1dc33
commit
457d292b0e
4 changed files with 5 additions and 6 deletions
|
|
@ -1,5 +1,3 @@
|
|||
const esModules = ['@grafana', 'uplot', 'ol', 'd3', 'react-colorful', 'uuid', 'openapi-fetch'].join('|');
|
||||
|
||||
module.exports = {
|
||||
...require('./.config/jest.config'),
|
||||
testEnvironment: 'jsdom',
|
||||
|
|
@ -7,8 +5,6 @@ module.exports = {
|
|||
moduleDirectories: ['node_modules', 'src'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'd.ts', 'cjs'],
|
||||
|
||||
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
|
||||
|
||||
moduleNameMapper: {
|
||||
'grafana/app/(.*)': '<rootDir>/src/jest/grafanaMock.ts',
|
||||
'openapi-fetch': '<rootDir>/src/jest/openapiFetchMock.ts',
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
"test-utc": "TZ=UTC jest --verbose --testNamePattern '^((?!@london-tz).)*$'",
|
||||
"test-london-tz": "TZ=Europe/London jest --verbose --testNamePattern '@london-tz'",
|
||||
"test": "yarn test-utc && yarn test-london-tz",
|
||||
"test:ci": "yarn test",
|
||||
"test:report": "HTML_REPORT_ENABLED=true yarn test",
|
||||
"test:silent": "yarn test --silent",
|
||||
"test:e2e": "yarn playwright test --grep-invert @expensive",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"generate": "npx ts-node-esm -P ./types-generator.tsconfig.json ./generate-types.ts && prettier --write ../autogenerated-api.types.d.ts"
|
||||
"generate": "node --loader ts-node/esm ./generate-types.ts && prettier --write ../autogenerated-api.types.d.ts"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
},
|
||||
"ts-node": { "esm": true }
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue