chore(deps): update jest monorepo to v29.4.0 (#423)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Lautzenheiser <lautzd@gmail.com>
This commit is contained in:
renovate[bot] 2023-01-24 11:44:08 -05:00 committed by GitHub
parent 94ff988c7e
commit 5839aaec2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 578 additions and 676 deletions

View File

@ -1,18 +0,0 @@
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.base');
module.exports = {
preset: 'ts-jest',
transform: {
'\\.[jt]sx?$': ['ts-jest', { tsConfig: 'tsconfig.dev.json' }],
'^.+\\.svg$': './test/fileTransformer',
},
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
'\\.(css|less)$': '<rootDir>/src/__mocks__/styleMock.ts',
},
transformIgnorePatterns: [],
setupFiles: ['./test/setupEnv.js'],
testRegex: '\\.ispec\\.tsx?$',
};

View File

@ -1,18 +0,0 @@
const { pathsToModuleNameMapper } = require('ts-jest');
const { compilerOptions } = require('./tsconfig.base');
module.exports = {
preset: 'ts-jest',
transform: {
'\\.[jt]sx?$': ['ts-jest', { tsConfig: 'tsconfig.dev.json' }],
'^.+\\.svg$': './test/fileTransformer',
},
moduleNameMapper: {
...pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
'\\.(css|less)$': '<rootDir>/src/__mocks__/styleMock.ts',
},
setupFiles: ['./test/setupEnv.js'],
testRegex: '\\.spec\\.tsx?$',
snapshotSerializers: ['@emotion/jest/serializer'],
};

View File

@ -5,7 +5,7 @@ const { compilerOptions } = require('./tsconfig.base');
module.exports = { module.exports = {
preset: 'ts-jest', preset: 'ts-jest',
transform: { transform: {
'\\.[jt]sx?$': ['ts-jest', { tsConfig: 'tsconfig.dev.json' }], '\\.[jt]sx?$': ['ts-jest', { tsconfig: 'tsconfig.dev.json' }],
'^.+\\.svg$': './test/fileTransformer', '^.+\\.svg$': './test/fileTransformer',
}, },
moduleNameMapper: { moduleNameMapper: {

View File

@ -5,7 +5,7 @@ const { compilerOptions } = require('./tsconfig.base');
module.exports = { module.exports = {
preset: 'ts-jest', preset: 'ts-jest',
transform: { transform: {
'\\.[jt]sx?$': ['ts-jest', { tsConfig: 'tsconfig.dev.json' }], '\\.[jt]sx?$': ['ts-jest', { tsconfig: 'tsconfig.dev.json' }],
'^.+\\.svg$': './test/fileTransformer', '^.+\\.svg$': './test/fileTransformer',
}, },
moduleNameMapper: { moduleNameMapper: {

View File

@ -234,8 +234,8 @@
"fs-extra": "11.1.0", "fs-extra": "11.1.0",
"gitlab": "14.2.2", "gitlab": "14.2.2",
"http-server": "14.1.1", "http-server": "14.1.1",
"jest": "29.3.1", "jest": "29.4.0",
"jest-environment-jsdom": "29.3.1", "jest-environment-jsdom": "29.4.0",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"mockserver-client": "5.15.0", "mockserver-client": "5.15.0",
"mockserver-node": "5.15.0", "mockserver-node": "5.15.0",

View File

@ -1,13 +1,9 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import API, { getMaxAccess } from '../API'; import API, { getMaxAccess } from '../API';
global.fetch = jest.fn().mockRejectedValue(new Error('should not call fetch inside tests')); global.fetch = jest.fn().mockRejectedValue(new Error('should not call fetch inside tests'));
describe('GitLab API', () => { describe('GitLab API', () => {
beforeAll(() => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
jest.spyOn(console, 'error').mockImplementation(() => {});
});
beforeEach(() => { beforeEach(() => {
jest.resetAllMocks(); jest.resetAllMocks();
}); });
@ -136,6 +132,8 @@ describe('GitLab API', () => {
test('should return false on shared group access_level >= 30, error getting branch', async () => { test('should return false on shared group access_level >= 30, error getting branch', async () => {
const api = new API({ repo: 'repo' }); const api = new API({ repo: 'repo' });
const consoleError = jest.spyOn(console, 'error').mockImplementation(() => {});
const requestJSONMock = (api.requestJSON = jest.fn()); const requestJSONMock = (api.requestJSON = jest.fn());
requestJSONMock.mockResolvedValueOnce({ requestJSONMock.mockResolvedValueOnce({
permissions: { project_access: null, group_access: null }, permissions: { project_access: null, group_access: null },
@ -147,8 +145,10 @@ describe('GitLab API', () => {
await expect(api.hasWriteAccess()).resolves.toBe(false); await expect(api.hasWriteAccess()).resolves.toBe(false);
expect(console.error).toHaveBeenCalledTimes(1); expect(consoleError).toHaveBeenCalledTimes(1);
expect(console.error).toHaveBeenCalledWith('Failed getting default branch', error); expect(consoleError).toHaveBeenCalledWith('Failed getting default branch', error);
consoleError.mockRestore();
}); });
}); });

1196
yarn.lock

File diff suppressed because it is too large Load Diff