Setting up the Jest-pack for the future Projects
- HTML
- CSS
- JavaScipt
- Webpack
- ES6
- Jest
👤 Bhagyashree Patra
- GitHub: @Vagyasri
- Twitter: @Vagyasri
- LinkedIn: Bhagyashree Patra
- Web browser
- Code Editor (VS Code)
- Live Server Extension
- Copy this link
- Open your terminal or command line
- Run "git clone Paste this link"
- Open the folder with your code editor
- Now You can edit the code and check the changes in the browser using Live Server
-
Install Jest using NPM:
npm install --save-dev jest
-
Add the following section to your package.json:
"scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "jest", "start": "webpack serve --open", "build": "webpack" },
-
babel-jest
is automatically installed when installing Jest and will automatically transform files if a babel configuration exists in your project. To avoid this behavior, you can explicitly reset the transform configuration option: (Create a file namedjest.config.js
)
// jest.config.js
module.exports = {
transform: {},
};
-
Install by Running:
npm install --save-dev @babel/plugin-transform-modules-commonjs
-
Configure Babel to target your current version of Node by creating a
babel.config.js
file in the root of your project:
module.exports = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}]],
};
// babel.config.js
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
+ '@babel/preset-typescript',
],
};
- Run:
npm run test
ornpm test
- Run:
npm start
- Install npm
- For HTML: Run npx hint .
- For CSS: Run npx stylelint "**/*.{css,scss}"
- For JS: Run npx eslint .
Contributions, issues, and feature requests are welcome!
Start by:
- Forking the project
- Cloning the project to your local machine
- cd into the Youtube-Replica project directory
- Run git checkout -b your-branch-name
- Make your contributions
- Push your branch up to your forked repository
- Open a Pull Request with a detailed description to the development branch of the original project for a review
Feel free to check the issues page, contribute to the Project by creating an issue.
Give a ⭐️ if you like this project!