Skip to content

feat: v3.0.0-alpha - Testing, Build, and CI Infrastructure - #110

Merged
usernane merged 11 commits into
mainfrom
dev
Aug 24, 2026
Merged

feat: v3.0.0-alpha - Testing, Build, and CI Infrastructure#110
usernane merged 11 commits into
mainfrom
dev

Conversation

@usernane

Copy link
Copy Markdown
Owner

Summary

This PR completes the v3.0.0-alpha milestone, establishing the foundation for the v3 enterprise-ready release.

Changes

Testing Infrastructure

  • Jest configuration with jsdom environment
  • 95 tests covering:
    • send() method (16 tests)
    • Callback pool management (25 tests)
    • Parameter serialization (19 tests)
    • Retry mechanism (16 tests)
    • CSRF token extraction (14 tests)
    • Smoke tests (5 tests)

Build Tooling

  • Rollup configuration for module bundling
  • Generated bundles:
    • ESM (ajaxrequest.esm.js, ajaxrequest.esm.min.js)
    • CommonJS (ajaxrequest.cjs.js, ajaxrequest.cjs.min.js)
    • UMD (ajaxrequest.umd.js, ajaxrequest.umd.min.js)
  • Source maps for all bundles

Code Quality

  • ESLint configuration with flat config format
  • Auto-fixed formatting issues (trailing spaces, quotes, indentation)

CI/CD

  • GitHub Actions workflow for tests (Node 18.x, 20.x)
  • GitHub Actions workflow for linting
  • Codecov integration for coverage reporting

Closed Issues

Closes #79, #80, #81, #82, #83, #84, #85, #86, #87, #88, #89, #90, #91, #92

Test Results

Test Suites: 6 passed, 6 total
Tests:       95 passed, 95 total

Ibrahim BinAlshikh added 11 commits August 24, 2026 00:45
- Add 16 tests covering send() functionality
- Test GET, POST, PUT, DELETE request methods
- Test parameter handling (object, string, FormData)
- Test disabled AJAX behavior
- Test custom headers (config and addHeader)
- Test base URL prepending
- Update loader helper to support mock injection

Closes #80
- Add 25 tests covering callback pool operations
- Test adding callbacks as function and object
- Test custom ID and call conditions (boolean/function)
- Test duplicate ID rejection (same pool vs different pools)
- Test removeCall, setCallEnabled, setCallsEnabled
- Test getCallbacksIDs and getCallBack methods
- Test callback configuration via constructor

Closes #81
- Add 19 tests covering parameter serialization behavior
- Test string params passthrough for GET and POST
- Test object to query string conversion for GET
- Test object to FormData conversion for POST/PUT
- Test array serialization (strings, numbers, booleans)
- Test null/undefined value exclusion
- Test File and Blob handling in FormData
- Test FormData passthrough unchanged
- Test setParams method

Closes #82
- Add 16 tests covering retry functionality
- Test setRetry configuration and validation
- Test retry triggers on connection lost (status 0)
- Test retry callback parameters (remaining seconds, pass number)
- Test retry stops after max attempts
- Test interval cleanup (retry.id set, retry.passed reset)
- Test default retry configuration (3 times, 5 seconds)
- Test retry does not trigger for success/4xx/5xx responses
- Test times=0 disables retry

Closes #83
- Add 14 tests covering CSRF token functionality
- Test extraction from window.csrfToken
- Test extraction from meta tag (name="csrf-token")
- Test extraction from input element (name="csrf-token")
- Test returns undefined when not found
- Test priority: window > meta > input
- Test fallback when meta has no content
- Test X-CSRF-TOKEN header sent on POST/PUT/DELETE
- Test token NOT sent on GET
- Test token caching in window.csrfToken

Closes #84
- Create test.yml workflow
- Run on push to main/master and all PRs
- Test on Node 18.x and 20.x
- Cache node_modules via setup-node
- Upload coverage to Codecov on Node 20.x

Closes #85
- Add ESLint and @eslint/js as dev dependencies
- Create eslint.config.js with flat config format
- Configure browser and Jest globals
- Add lint and lint:fix scripts to package.json

Closes #87
- Create lint.yml workflow
- Run ESLint on push to main/master and all PRs
- Fail on lint errors

Closes #86
- Auto-fix trailing spaces, quotes, and indentation in AJAXRequest.js
- Auto-fix formatting in test files
- Update ESLint config to treat code quality issues as warnings
- Remaining 29 warnings are redeclare/unused-vars issues needing refactoring

Closes #88
- Add Rollup and @rollup/plugin-terser as dev dependencies
- Create rollup.config.js with ESM, CJS, and UMD builds
- Configure minified versions with source maps
- Add build script to package.json

Closes #89
- Add release-please GitHub Actions workflow
- Configure to create release PRs on push to main
- Auto-publish to npm when release is created
- Set up manifest with current version (2.1.8)
@usernane
usernane merged commit 4fc8538 into main Aug 24, 2026
2 of 3 checks passed
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.

chore(test): add Jest configuration

1 participant