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

Re-enable edge environment testing #6

Closed
tnez opened this issue Jun 29, 2023 · 0 comments · Fixed by #23 or #22
Closed

Re-enable edge environment testing #6

tnez opened this issue Jun 29, 2023 · 0 comments · Fixed by #23 or #22

Comments

@tnez
Copy link
Owner

tnez commented Jun 29, 2023

I had to temporarily disable the edge environment testing because it did not play nicely with the auto mocking behavior in Jest. It seems the auto-mocking does some kind of eval from string which is disabled in edge-runtime.

Need to:

  1. Update the test script in package.json to: "test": "jest --env @edge-runtime/jest-environment .test.ts && jest --env node .test.ts",
  2. Refactor the mocks in action.test.ts so that they work in the @edge-runtime/jest-environment
@tnez tnez closed this as completed in #23 Jun 30, 2023
tnez added a commit that referenced this issue Jun 30, 2023
Re-enable edge-environment for unit tests in CI (closes #6)
tnez pushed a commit that referenced this issue Jun 30, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @tnezdev/actions@0.3.1

### Patch Changes

-   b17bfb8: Add license (`Apache 2.0`)
-   f48413d: Re-enable edge-environment for unit tests in CI (closes #6)
-   9a7833e: fix: add missing type exports (closes #24)

    The documentation gives an example of doing something like this:

    ```ts
    import { createAction } from "@tnezdev/actions";
    import type { ActionHandler } from "@tnezdev/actions";

    type Conetxt = {};
    type Input = {};
    type Output = {};

    const handler: ActionHandler<Context, Input, Output> = () => {};
    ```

However, the `ActionHandler` type was not being exported before this
fix.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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 a pull request may close this issue.

1 participant