Skip to content

Conversation

Copy link

Copilot AI commented Nov 6, 2025

Closes: (issue reference needed)

Description

Added comprehensive test coverage for the Big presentation library using Jest and jsdom.

Test Infrastructure

  • Jest with jsdom environment for DOM testing
  • npm scripts: test, test:watch, test:coverage
  • GitHub Actions workflow for CI on Node 18.x and 20.x
  • CI/CD status badge in README
  • .gitignore for node_modules and coverage artifacts

Test Coverage (17 passing tests)

  • Utility functions: emptyNode(), ce(), parseHash() - validates core helpers
  • API surface: Confirms window.big object, navigation methods (forward, reverse, go), and event listeners (keyboard, click, touch)
  • Feature detection: Validates presentation modes (talk/print/jump), speaker notes, aspect ratio configuration
  • File structure: Verifies big.js, big.css, and index.html exist with expected content

Integration Tests

8 integration tests skipped - jsdom doesn't support window.location.hash manipulation that big.js requires. Tests structured for future implementation with Puppeteer/Playwright.

Tradeoffs

  • Skipped runtime integration tests due to jsdom limitations rather than adding Puppeteer dependency
  • Used new Function() to load big.js in tests to avoid let re-declaration issues - acceptable for test-only usage

Example Usage

npm test                  # Run tests
npm run test:watch        # Watch mode
npm run test:coverage     # Generate coverage report

See TEST_README.md for detailed test documentation.

Original prompt

Create tests for this library


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add tests for the library Add test suite for Big presentation library Nov 6, 2025
Copilot AI requested a review from sroberts November 6, 2025 03:14
Copilot finished work on behalf of sroberts November 6, 2025 03:14
@sroberts
Copy link
Owner

sroberts commented Nov 6, 2025

@copilot Add CI/CD status to the README.

Copy link
Author

Copilot AI commented Nov 6, 2025

@copilot Add CI/CD status to the README.

Added CI/CD status badge to the README showing the Tests workflow status. (752677a)

@sroberts sroberts marked this pull request as ready for review November 6, 2025 03:21
Copilot finished work on behalf of sroberts November 6, 2025 03:21
@sroberts sroberts merged commit 907fcc3 into master Nov 6, 2025
4 checks passed
@sroberts sroberts deleted the copilot/add-library-tests branch November 6, 2025 03:23
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.

2 participants