Skip to content

Add unit testing guide - #841

Open
mtuchi wants to merge 11 commits into
mainfrom
unit-testing
Open

mtuchi wants to merge 11 commits into
mainfrom
unit-testing

Conversation

@mtuchi

@mtuchi mtuchi commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Short Description

Adds a new docs page, "Writing unit tests for your jobs", covering how to compile job code with openfn compile --exports-only and test the helper functions with a standard JavaScript test runner. Cross-linked from the job writing guide and the two CLI pages.

Closes #840

Details

  • New page docs/jobs/unit-testing-jobs.md, added to the sidebar under Write Jobs, after jobs/compilation
  • docs/jobs/job-writing-guide.md picks up a short "your helpers can be unit tested" pointer in Next Steps
  • docs/build-for-developers/cli-intro.md gains a bullet in the "you can use the OpenFn CLI to..." list
  • docs/build-for-developers/cli-usage.md gains a "Compile job code for unit testing" section

Walk through video

AI Usage

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

@mtuchi mtuchi changed the title wip: unit testing docs Add unit testing guide Sep 16, 2026
@mtuchi
mtuchi requested a review from PiusKariuki September 16, 2026 09:03
@mtuchi
mtuchi marked this pull request as ready for review September 16, 2026 09:03
Comment thread docs/jobs/job-writing-guide.md Outdated

@PiusKariuki PiusKariuki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is so good @mtuchi . I have just one minor comment for you.

Comment thread docs/build-for-developers/cli-usage.md Outdated
Comment thread docs/build-for-developers/cli-intro.md Outdated
Comment thread docs/build-for-developers/cli-intro.md Outdated
Comment thread docs/build-for-developers/cli-usage.md Outdated
Comment thread docs/build-for-developers/cli-usage.md Outdated
Comment thread docs/jobs/job-writing-guide.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
@mtuchi
mtuchi requested a review from josephjclark September 17, 2026 14:29

@josephjclark josephjclark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI isn't ready to write out docsite yet.

I don't like it. The more closely I read this the more problems I find :(

I think I'd rather have a really short, concise guide to unit testing which doesn't have all this explanation. It's long and repetetive and confusing - I'm not convinced we need 500 lines of this.

Comment thread docs/build-for-developers/cli-usage.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md Outdated
Comment thread docs/jobs/unit-testing-jobs.md
@mtuchi
mtuchi requested a review from josephjclark September 23, 2026 08:29
@mtuchi

mtuchi commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Hiya @josephjclark i have cut down lots of verbose stuff, please have another look

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

add a guide on unit testing job code

3 participants