This project would not be possible without your help and support, and we appreciate your willingness to contribute!
This project uses Vitest as the test runner to verify that code examples in the documentation work correctly.
# Run all tests once
npm test
# Run tests in watch mode (re-runs on file changes)
npm run test:watch
# Run tests with coverage report
npm run test:coverageTests are organized by concept in the tests/ directory:
tests/
├── call-stack/
│ └── call-stack.test.js
├── primitive-types/
│ └── primitive-types.test.js
└── ...
When adding new code examples to concept documentation, please include corresponding tests:
- File naming: Create
{concept-name}.test.jsintests/{concept-name}/ - Use explicit imports:
import { describe, it, expect } from 'vitest'
- Convert console.log examples to assertions:
// Documentation example: // console.log(typeof "hello") // "string" // Test: it('should return string type', () => { expect(typeof "hello").toBe("string") })
- Test error cases: Use
expect(() => { ... }).toThrow()for operations that should throw - Skip browser-specific examples: Tests run in Node.js, so skip DOM/window/document examples
- Note strict mode behavior: Vitest runs in strict mode, so operations that "silently fail" in non-strict mode will throw
TypeError
To create a new translation, please follow these steps:
- Fork the main repository.
- Add yourself to the watch list of the main repository to stay updated with any changes.
- Translate the repository on your forked copy.
- Go to the main repository and edit the README.md file to include a link to your translated repository.
- Inside the Community section, add a new line with the link to your translated repository in the following format:
- [Your language in native form (English name)](link to your repository here) — Your Name
- For example,
[日本語 (Japanese)](https://github.com/oimo23/33-js-concepts) — oimo23
- Create a new Pull Request with the name "Add your language here translation."
- Now, just wait for the merge!
By contributing, you agree that your contributions will be licensed under the MIT license.