Skip to content

Conversation

@TrevorBurgoyne
Copy link
Member

@TrevorBurgoyne TrevorBurgoyne commented Oct 8, 2025

Testing

Description

  • Add testing using jest
    • Closes Automated Testing #177
    • Basic unit tests
    • Basic end to end testing using playwright and the demo app
    • Just a start - many more test cases can be added
  • Fix circular webpack builds by forcibly cleaning the dist/ directory before each build
    • Also use import type... from ".." instead of just import to fix ts not properly resolving imports to js
    • Reduced bundle size from ~20 MB -> 1 MB
  • Refactor some more console.warn and console.error instances to use log_message
  • Remove deprecated parent_id field from ULabelAnnotation

PR Checklist

  • Merged latest main
  • Version number in package.json has been bumped since last release
  • Version numbers match between package package.json and src/version.js
  • Ran npm install and npm run build AFTER bumping the version number
  • Updated documentation if necessary (currently just in api_spec.md)
  • Added changes to changelog.md

Breaking API Changes

parent_id is no longer included for annotations, but afaik it was always null anyways

@TrevorBurgoyne TrevorBurgoyne marked this pull request as ready for review October 9, 2025 19:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces automated testing infrastructure to the ULabel project and addresses several build and code quality issues. The main purpose is to establish Jest for unit testing and Playwright for end-to-end testing, while fixing circular webpack builds that were causing bundle bloat.

Key changes include:

  • Addition of comprehensive test suites covering core ULabel functionality and annotation operations
  • Implementation of build optimizations that reduced bundle size from ~20 MB to 1 MB
  • Refactoring of import statements and console logging to use proper TypeScript patterns and centralized logging

Reviewed Changes

Copilot reviewed 33 out of 41 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/ New testing infrastructure with Jest unit tests and Playwright e2e tests
package.json Added testing dependencies and scripts, version bump to 0.19.1
src/ TypeScript import fixes using import type and centralized error logging
.github/workflows/test.yml CI/CD pipeline for automated testing
playwright.config.js Playwright configuration for e2e testing
eslint.config.mjs ESLint rules for test files

Copy link
Collaborator

@joshua-dean joshua-dean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Only thing I can think of would be to rename tests/utils -> tests/testing-utils (or tests/testing_utils), just in case we end up with an src/utils in the future.

@TrevorBurgoyne TrevorBurgoyne merged commit a94f623 into main Oct 15, 2025
3 checks passed
@TrevorBurgoyne TrevorBurgoyne deleted the feature/tests branch October 15, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automated Testing

3 participants