Skip to content

Conversation

@Ethan-Arrowood
Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood commented Oct 27, 2025

  • Fixes up new unit test scripts and configuration and adds some docs for it in contributing.md
  • Makes some necessary changes to package.json like removing type and adding some missing dependenices
  • formats repo
  • ignores format commit
  • adds a workflow to enforce formatting

Land this PR with a merge commit so we retain necessary commit history particularly around the formatting changes.

@Ethan-Arrowood Ethan-Arrowood marked this pull request as ready for review October 27, 2025 19:51
@Ethan-Arrowood Ethan-Arrowood requested review from a team as code owners October 27, 2025 19:51
on:
push:
branches: [main]
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pull_request:
pull_request:
types: [opened, synchronize, reopened]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whats the difference compared to the default? The other workflows don't specify these types. Just curious

Copy link
Contributor

Choose a reason for hiding this comment

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

It's just something I started doing a couple years ago because a project I worked on would run CI for both push and pull requests, effectively running CI twice. I didn't know GH workflows back then and whoever set up the triggers didn't either! I fixed it by explicitly set the types and branches (main), then things started to behave. So I just looked into what the valid types are and turns out that pened, synchronize, and reopened are the default types! So, nevermind, you can ignore this. :)

if (
config &&
typeof config === 'object' &&
config !== null &&
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is unnecessary.

Suggested change
config !== null &&

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to refrain from making core changes in this pr; only reason this code is changing is cause of the format. We can make edits like this separately.

{
'204': new Response204(),
}
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Holy smokes, the formatter actually made the code more readable!

Ethan-Arrowood and others added 2 commits October 27, 2025 14:53
Co-authored-by: Chris Barber <chris@cb1inc.com>
@Ethan-Arrowood
Copy link
Contributor Author

@cap10morgan I'm tagging you for review directly since I'm making changes to some of the unit test code you recently added. Happy to discuss the changes in more detail 😄

Copy link
Contributor

@cap10morgan cap10morgan left a comment

Choose a reason for hiding this comment

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

Looks good to me!

"format:write": "prettier --write .",
"test:integration": "node --test integrationTests/apiTests/tests/testSuite.mjs",
"test:unit": "npm run build || true; npx mocha unitTests --config unitTests/.mocharc.json"
"test:unit": "TSX_TSCONFIG_PATH=./unitTests/tsconfig.json npx mocha --config unitTests/.mocharc.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

I was trying to find something like this! I really wanted to split out the test TS config into a separate file like you did but couldn't find a way to tell TSX to use it. Awesome!

"format:check": "prettier --check .",
"format:write": "prettier --write .",
"test:integration": "node --test integrationTests/apiTests/tests/testSuite.mjs",
"test:unit": "npm run build || true; npx mocha unitTests --config unitTests/.mocharc.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is going to trip people up when the tests are run against the TS compiled output. Should we mention this somewhere? Maybe in a dev / contributing doc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah definitely worth mentioning. I can adjust the contributing doc

@Ethan-Arrowood Ethan-Arrowood merged commit 05fd3c4 into main Oct 28, 2025
6 of 7 checks passed
@Ethan-Arrowood Ethan-Arrowood deleted the general-repo-updates branch October 28, 2025 17:06
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.

5 participants