Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better error handling when loading tasks using esm #133

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

abendigo
Copy link
Contributor

@abendigo abendigo commented Dec 7, 2022

🤔 What's changed?

Better Error Handling when loading tasks in an ESM environment.

⚡️ What's your motivation?

The errors were getting swallowed, slowing the addition of tests.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, documentation etc. without changing behaviour)

♻️ Anything particular you want feedback on?

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@abendigo abendigo force-pushed the marko/better-error-handling-esm-tasks branch from 2145726 to f311e20 Compare December 7, 2022 02:27
const world = new TestWorld(options)

// Load the task
await asyncAssignTasks(world, `${__dirname}/fixtures/tasks/goodtasks`)
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand something here.

On line 12 we've defined goodtask as () => Action<void> but that's also what's defined in the goodtask.ts fixture.

Should we be using the result of this call to asynAssignTasks to set up the goodtask property on our TestWorld on line 12, instead of hard-coding / duplicating it?


// error compiling
it('fails with a helpful error message if the task could not be compiled', async () => {
class TestWorld extends ActorWorld {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need lines 26-30 for this test?

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.

None yet

2 participants