A TypeScript-based boilerplate for creating Chrome Extensions, providing a solid foundation with essential features like background scripts, content scripts, and a popup interface.
Unit testing is a crucial part of maintaining code quality and preventing regressions. Adding Jest, a popular JavaScript testing framework, to our boilerplate will provide a solid foundation for writing and running tests.
Objective
Integrate Jest into the ChromeTS Launchpad boilerplate to enable unit testing for TypeScript code.
Tasks
[ ] Install necessary packages:
npm install --save-dev jest @types/jest ts-jest
[ ] Create a Jest configuration file (jest.config.js) in the project root:
Background
Unit testing is a crucial part of maintaining code quality and preventing regressions. Adding Jest, a popular JavaScript testing framework, to our boilerplate will provide a solid foundation for writing and running tests.
Objective
Integrate Jest into the ChromeTS Launchpad boilerplate to enable unit testing for TypeScript code.
Tasks
jest.config.js
) in the project root:package.json
:src/__tests__/sample.test.ts
) with a basic test:Resources
Notes