Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

fix types for tests for non-react packages#2011

Merged
peter-hamilton merged 9 commits intomainfrom
type-check-tests
Aug 25, 2021
Merged

fix types for tests for non-react packages#2011
peter-hamilton merged 9 commits intomainfrom
type-check-tests

Conversation

@peter-hamilton
Copy link
Copy Markdown
Contributor

Description

Enabled type checking for tests in a number of quilt packages.

Changes

  • date
    • specify Intl.DateTimeFormatOptions type for options.
  • koa-performance
    • koa middleware was missing a next argument. Passed () => Promise.resolve
  • koa-shopify-webhooks
    • Made Options.deliveryMethod an optional parameter because it has a default value in registerWebhook(). Tests were using the default value.
    • Used 'unstable' for cases where apiVersion was missing in tests.
    • fetchMock.lastCall() returns | undefined causing assignment errors. Fixed with non-null assertion operators.
  • magic-entries-webpack-plugin
    • Used non-null assertion operator for optional webpack.Stats.ToJsonOutput.modules param.
  • performance
    • Adjusted some casting logic.
  • statsd
    • name variable was being passed to several mock functions, but wasn't defined. Used stats variable to align with the other tests.
  • web-worker - Note: these tests are currently skipped.
    • Worker import changed to WebWorker
    • Add non-null assertion to workerElement retrieved from page.waitForSelector
    • in getTestClassInstanceCount typescript complains that the function signatures between Page and ExecutionContext aren't compatible. Solved by adding typeguards and duplicating the function calls. Couldn't find a cleaner solution.

Type of change

  • date Patch: Bug (non-breaking change which fixes an issue)
  • koa-performance Patch: Bug (non-breaking change which fixes an issue)
  • koa-shopify-webhooks Patch: Bug (non-breaking change which fixes an issue)
  • magic-entries-webpack-plugin Patch: Bug (non-breaking change which fixes an issue)
  • performance Patch: Bug (non-breaking change which fixes an issue)
  • statsd Patch: Bug (non-breaking change which fixes an issue)
  • web-worker Patch: Bug (non-breaking change which fixes an issue)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above (Documentation fix and Test update does not need a changelog as we do not publish new version)

@peter-hamilton peter-hamilton requested a review from a team August 25, 2021 17:27
@peter-hamilton peter-hamilton marked this pull request as ready for review August 25, 2021 18:04
Copy link
Copy Markdown
Member

@BPScott BPScott left a comment

Choose a reason for hiding this comment

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

🎉

@peter-hamilton peter-hamilton merged commit 549b36d into main Aug 25, 2021
@peter-hamilton peter-hamilton deleted the type-check-tests branch August 25, 2021 19:31
@shopify-shipit shopify-shipit bot temporarily deployed to production August 26, 2021 14:49 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to michenly-beta August 26, 2021 17:50 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to gem August 30, 2021 18:42 Inactive
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants