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

feat: support edge runtime #1574

Merged
merged 7 commits into from Jul 2, 2022
Merged

Conversation

promer94
Copy link
Contributor

add environment support for https://github.com/vercel/edge-runtime

limitations

eval and new Function() still works in vitest edge environment.
#1470 might help to solve this problem

// ❌ 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);
});

@netlify
Copy link

netlify bot commented Jun 30, 2022

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 06ff358
🔍 Latest deploy log https://app.netlify.com/sites/vitest-dev/deploys/62c0124db3cd250008b058fb
😎 Deploy Preview https://deploy-preview-1574--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@promer94 promer94 changed the title Edge runtime feat: support edge runtime Jun 30, 2022
Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

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

I like this in general. Just a few details need to discuss

docs/config/index.md Outdated Show resolved Hide resolved
packages/vitest/src/integrations/env/index.ts Outdated Show resolved Hide resolved
packages/vitest/src/node/cli-api.ts Outdated Show resolved Hide resolved
Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

Should we also add @edge-runtime/vm to peerDependencies? We have all other envs there

@sheremet-va sheremet-va enabled auto-merge (squash) July 2, 2022 09:28
@sheremet-va sheremet-va disabled auto-merge July 2, 2022 09:32
@sheremet-va sheremet-va enabled auto-merge (squash) July 2, 2022 09:41
@sheremet-va sheremet-va merged commit b947be4 into vitest-dev:main Jul 2, 2022
@promer94 promer94 deleted the edge-runtime branch July 2, 2022 10:24
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

3 participants