This commit is contained in:
Николай Вигдоров
2025-03-08 15:08:56 +03:00
parent d8aab58f8e
commit ebcef037fa
7 changed files with 15552 additions and 3 deletions

View File

@ -2,7 +2,8 @@
"env": {
"browser": true,
"es2020": true,
"node": true
"node": true,
"jest": true
},
"extends": ["eslint:recommended", "plugin:import/errors", "plugin:import/warnings"],
"parserOptions": {

1
babel.config.js Normal file
View File

@ -0,0 +1 @@
module.exports = {presets: ['@babel/preset-env']};

5
jest.config.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = {
transform: {
'^.+\\.(js|jsx)$': 'babel-jest',
},
};

15530
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,9 @@
"scripts": {
"start": "webpack serve --mode=development",
"dev": "webpack serve --mode=development --open=false",
"build": "webpack --mode=production"
"build": "webpack --mode=production",
"lint": "eslint -c .eslintrc.json src --fix",
"test": "jest"
},
"repository": {
"type": "git",
@ -20,6 +22,8 @@
},
"homepage": "https://github.com/vigdorov/examples-for-kids#readme",
"devDependencies": {
"@babel/preset-env": "^7.26.9",
"babel-jest": "^29.7.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.1",
"eslint": "^7.19.0",
@ -28,6 +32,7 @@
"favicons-webpack-plugin": "^5.0.1",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.0.0",
"jest": "^29.7.0",
"mini-css-extract-plugin": "^1.3.5",
"webpack": "^5.21.1",
"webpack-cli": "^4.5.0",

7
src/consts.test.js Normal file
View File

@ -0,0 +1,7 @@
import {DIFFICULTY, START_BUTTON_EASY_ID} from './consts';
describe('getDifficultyById', () => {
it('should return correct difficulty', () => {
expect(DIFFICULTY[START_BUTTON_EASY_ID]).toBe(10);
});
});

View File

@ -130,7 +130,7 @@ const getExample = () => {
};
const getDifficultyById = id => {
export const getDifficultyById = id => {
return DIFFICULTY[id];
};