Skip to content

Switch to pnpm and run tests against edge-runtime. #188

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

Merged
merged 3 commits into from
Jun 26, 2022
Merged

Switch to pnpm and run tests against edge-runtime. #188

merged 3 commits into from
Jun 26, 2022

Conversation

leerob
Copy link
Member

@leerob leerob commented Jun 21, 2022

This PR runs the Jest test suite against the Edge Runtime: a toolkit for developing and testing against Edge environments (like Edge Functions).

For example, the following test would pass:

// jest --env node
// ✅ Pass
it('should return the correct value', () => {
  let val = eval('2 + 2');
  expect(val).toBe(4);
});

The following test would fail when using the Edge Runtime:

// jest --env @edge-runtime/jest-environment
// ❌ Fail
// Error name:    "EvalError"
// Error message: "Code generation from strings disallowed for this context"
it('should return the correct value', () => {
  let val = eval('2 + 2');
  expect(val).toBe(4);
});

All tests inside this repository pass against both environments. This PR also does some housekeeping:

  • Switches to pnpm
  • Updates the README copyright year

@leerob leerob marked this pull request as ready for review June 21, 2022 03:34
@leerob leerob merged commit 78ce59e into master Jun 26, 2022
@leerob leerob deleted the edge branch June 26, 2022 17:45
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.

2 participants