Skip to content

Commit

Permalink
Add jest, i18n and react-query (#175)
Browse files Browse the repository at this point in the history
Add jest, i18n and react-query
  • Loading branch information
mtfranchetto authored Jul 8, 2022
1 parent ddff143 commit a6f1e2a
Show file tree
Hide file tree
Showing 10 changed files with 14,363 additions and 5,324 deletions.
26 changes: 26 additions & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const merge = require('lodash/merge');
const nextJest = require('next/jest')
const awsuiPreset = require('@awsui/jest-preset/jest-preset');

const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})

// Add any custom config to be passed to Jest
const customJestConfig = {
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
// if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
}

async function mergePolarisPreset() {
const nextConfig = await createJestConfig(customJestConfig)()
const mergedConfig = merge({}, nextConfig, awsuiPreset)

return mergedConfig
}

module.exports = mergePolarisPreset
7 changes: 7 additions & 0 deletions frontend/locales/en/strings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"global": {
"menu": {
"home": "Home"
}
}
}
Loading

0 comments on commit a6f1e2a

Please sign in to comment.