microsoft / microsoft/vscode-react-native

[Documentation] Update CONTRIBUTING.md with current test execution instructions

Open
#2,944 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

📚 documentation follow-up
Dominant language
TypeScript
Stars
2.7k
Forks
295
Avg merge
11h 17m
Merged PRs (30d)
24

Description

Summary

The CONTRIBUTING.md file contains outdated test execution instructions that don't fully match current project setup.

Current Issues

  1. Test command inconsistency:

    • CONTRIBUTING.md mentions npm test and npm run test-localization
    • package.json shows these scripts exist but additional test commands are available
    • No mention of test:coverage command that exists in gulpfile.js
  2. Smoke test documentation:

    • Says to run yarn smoke-tests but package.json uses npm, not yarn
    • References Launch All Smoke Tests command but no details about setup requirements
    • Links to test/smoke/docs/run-locally.md for setup but doesn't explain prerequisites
  3. Missing test information:

    • No mention of test-no-build option
    • No explanation of watch mode (watch-build-test)
    • No coverage of gulp test vs npm test differences

Current Documentation

## Testing

There is a set of Mocha tests for the extension and extension localization which can be run with `npm test` and `npm run test-localization` or by `Launch Extension Tests` and `Launch Localization Tests`. Also there are e2e smoke tests placed in [`test/smoke`](https://github.com/microsoft/vscode-react-native/tree/master/test/smoke) folder that can be launched by `yarn smoke-tests` command or by `Launch All Smoke Tests` command. Make sure to [prepare test environment](https://github.com/microsoft/vscode-react-native/blob/master/test/smoke/docs/run-locally.md) before launching e2e tests.

Proposed Changes

Update CONTRIBUTING.md to include:

  1. Test Types:

    • Unit tests: What they cover, how to run
    • Smoke tests: What they cover, prerequisites
    • Localization tests: Purpose and execution
  2. Test Commands:

    # Run unit tests
    npm test
    
    # Run tests with coverage report
    gulp test:coverage
    
    # Run tests without rebuild
    gulp test-no-build
    
    # Watch mode for development
    gulp watch-build-test
    
    # Run localization tests
    npm run test-localization
    
    # Run smoke tests (requires environment setup)
    npm run smoke-tests
    
  3. VS Code Launch Configurations:

    • List available launch configs
    • Explain when to use each one
  4. Smoke Test Setup:

    • Summarize key prerequisites
    • Link to detailed setup guide
    • Mention platform-specific requirements
  5. Test Coverage:

    • How to view coverage reports
    • Where coverage files are generated
    • Target coverage goals (if any)

Example Section

## Testing

The project has three types of automated tests:

### Unit Tests
Unit tests cover extension functionality, commands, debugger logic, and utilities.

**Run all unit tests:**
```bash
npm test

Run with coverage report:

gulp test:coverage

Skip rebuild (when code hasn't changed):

gulp test-no-build

VS Code launch config: Use Launch Extension Tests from the Debug panel.

Smoke Tests (E2E)

... [continue with smoke test details]

Localization Tests

... [continue with localization test details]


## Benefits

- Accurate documentation for contributors
- Clearer test execution workflow
- Better onboarding for new contributors
- Reduced confusion about test commands
- Alignment with actual project configuration

## References

- CONTRIBUTING.md line 30-31
- package.json test scripts
- gulpfile.js test tasks
- .vscode/launch.json configurations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CONTRIBUTING.md and compare its Testing section against the test scripts in package.json, tasks in gulpfile.js, .vscode/launch.json, and test/smoke/docs/run-locally.md. Update the documentation to cover the requested test types, commands, launch configurations, prerequisites, and coverage details, with all commands matching the current project configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
vscode
Domain
developer-experience, documentation, testing
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.