Skip to content

Commit a6f1e2a

Browse files
authored
Add jest, i18n and react-query (#175)
Add jest, i18n and react-query
1 parent ddff143 commit a6f1e2a

File tree

10 files changed

+14363
-5324
lines changed

10 files changed

+14363
-5324
lines changed

frontend/jest.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const merge = require('lodash/merge');
2+
const nextJest = require('next/jest')
3+
const awsuiPreset = require('@awsui/jest-preset/jest-preset');
4+
5+
const createJestConfig = nextJest({
6+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
7+
dir: './',
8+
})
9+
10+
// Add any custom config to be passed to Jest
11+
const customJestConfig = {
12+
// Add more setup options before each test is run
13+
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
14+
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
15+
moduleDirectories: ['node_modules', '<rootDir>/'],
16+
testEnvironment: 'jest-environment-jsdom',
17+
}
18+
19+
async function mergePolarisPreset() {
20+
const nextConfig = await createJestConfig(customJestConfig)()
21+
const mergedConfig = merge({}, nextConfig, awsuiPreset)
22+
23+
return mergedConfig
24+
}
25+
26+
module.exports = mergePolarisPreset

frontend/locales/en/strings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"global": {
3+
"menu": {
4+
"home": "Home"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)