- Node v25.9.0
- PNPM 10.30.3
$ pnpm initYou will be asked some questions, but just keep tapping "Enter" key.
$ pnpm install --save-dev jest babel-jest babel-core @babel/core @babel/preset-env$ pnpm install --save-dev jest babel-jestTo execute all unit tests, run npx jest.
$ pnpm jest
PASS __tests__/hello.test.js (24.047 s)
✓ Hello (3 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 48.781 s
Ran all test suites.To execute a unit test, run npx jest ./__test__/{filename}_test.js.
$ npx jest ./basic/__tests__/hello_test.js
PASS basic/__tests__/hello_test.js (15.283 s)
✓ hello (2 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 38.076 s
Ran all test suites matching /basic\/__tests__\/hello_test.js/i.To setup a local server, run the following command and access http://localhost:3000.
- To use another port, assign one with --port [port] option.
$ cd ajax
$ npx @js-primer/local-serverTo setup a local server, run the following command and access http://localhost:3000.
- To use another port, assign one with --port [port] option.
$ cd nodejs
$ npx @js-primer/local-serverTo execute unit tests, run the following command.
$ npm testTo setup a local server, run the following command and access http://localhost:3000.
- To use another port, assign one with --port [port] option.
$ cd todo_app
$ npx @js-primer/local-server