working tests

This commit is contained in:
Nikolai Petukhov 2024-10-19 10:13:06 +03:00
parent f3e93bae19
commit dd16f42995
3 changed files with 16 additions and 3 deletions

View File

@ -13,9 +13,9 @@ const config: Config = {
coverageProvider: "v8", coverageProvider: "v8",
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'], setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testEnvironment: "jsdom", testEnvironment: "jsdom",
transform: { // transform: {
'^.+\\.(ts|tsx|js|jsx)$': 'babel-jest', // '^.+\\.(ts|tsx|js|jsx)$': 'babel-jest',
}, // },
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx', 'js', 'jsx'], moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx', 'js', 'jsx'],
}; };

View File

@ -1 +1,14 @@
import { jest } from '@jest/globals';
import '@testing-library/jest-dom'; import '@testing-library/jest-dom';
import mockedConfig from './bro.config.js'
jest.mock('@brojs/cli', () => {
return {
getNavigations() {
return mockedConfig.navigations
},
getNavigationsValue(key) {
return mockedConfig.navigations[key]
}
}
})