fix add-missing-keys-to-other-language.test.js

This commit is contained in:
Pierre Noël 2022-07-11 14:40:58 +02:00
parent 6d265c2917
commit 9d0a01a051
6 changed files with 17 additions and 4 deletions

View File

@ -59,7 +59,9 @@ module.exports = {
},
transformIgnorePatterns: ['node_modules/(?!(react-dnd|dnd-core|react-dnd-html5-backend)/)'],
testMatch: ['/**/tests/**/?(*.)+(spec|test).[jt]s?(x)'],
testURL: 'http://localhost:1337/admin',
testEnvironmentOptions: {
url: 'http://localhost:1337/admin',
},
// Use `jest-watch-typeahead` version 0.6.5. Newest version 1.0.0 does not support jest@26
// Reference: https://github.com/jest-community/jest-watch-typeahead/releases/tag/v1.0.0
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],

View File

@ -2,5 +2,8 @@ const baseConfig = require('./jest.base-config.front');
module.exports = {
...baseConfig,
projects: ['<rootDir>/packages/**/jest.config.front.js'],
projects: [
'<rootDir>/packages/**/jest.config.front.js',
'<rootDir>/scripts/**/jest.config.front.js',
],
};

View File

@ -5,8 +5,8 @@ const { updateMissingKeysToJSON } = require('../add-missing-keys-to-other-langua
describe('updateMissingKeysToJSON', () => {
it('should add missing keys from en.json to translation file', async () => {
const TARGET_TRANSLATION_FILE_PATH = 'scripts/front/__tests__/vi.json';
const SOURCE_TRANSLATION_FILE_PATH = 'scripts/front/__tests__/en.json';
const TARGET_TRANSLATION_FILE_PATH = 'scripts/front/tests/vi.json';
const SOURCE_TRANSLATION_FILE_PATH = 'scripts/front/tests/en.json';
// Save original `vi.json` file content
const originalTargetTranslationFileContent = fs.readFileSync(
TARGET_TRANSLATION_FILE_PATH,

View File

@ -0,0 +1,8 @@
'use strict';
const baseConfig = require('../jest.base-config.front');
module.exports = {
...baseConfig,
roots: [__dirname],
};