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:
parent
94ff988c7e
commit
5839aaec2a
@ -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?$',
|
|
||||||
};
|
|
@ -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'],
|
|
||||||
};
|
|
@ -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: {
|
||||||
|
@ -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: {
|
||||||
|
@ -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",
|
||||||
|
@ -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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user