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

fix!: drop support for Vite 2 #1928

Merged
merged 4 commits into from Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tazerc.json
@@ -1,6 +1,6 @@
{
"exclude": [
"vite",
"vue",
"puppeteer",
"pretty-format",
"pathe"
Expand Down
2 changes: 1 addition & 1 deletion examples/lit/package.json
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@vitest/ui": "latest",
"happy-dom": "latest",
"jsdom": "latest",
"vite": "latest",
"vitest": "latest"
},
Expand Down
27 changes: 14 additions & 13 deletions examples/lit/test/basic.test.ts
@@ -1,26 +1,27 @@
import type { IWindow } from 'happy-dom'
import { beforeEach, describe, it, vi } from 'vitest'
import { beforeEach, describe, expect, it, vi } from 'vitest'

import '../src/my-button'

declare global {
interface Window extends IWindow {}
}

describe('Button with increment', async () => {
beforeEach(async () => {
document.body.innerHTML = '<my-button name="World"></my-button>'
await window.happyDOM.whenAsyncComplete()
await new Promise(resolve => setTimeout(resolve, 0))
})

function getInsideButton(): HTMLElement | null | undefined {
return document.body.querySelector('my-button')?.shadowRoot?.querySelector('button')
}

beforeEach(async () => {
document.body.innerHTML = '<my-button name="World"></my-button>'
await new Promise<void>((resolve) => {
const interval = setInterval(() => {
if (getInsideButton()) {
clearInterval(interval)
resolve()
}
})
})
})

it('should increment the count on each click', () => {
getInsideButton()?.click()
expect(getInsideButton()?.innerText).toContain('1')
expect(getInsideButton()?.textContent).toContain('1')
})

it('should show name props', () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/lit/vite.config.ts
Expand Up @@ -6,6 +6,6 @@ import { defineConfig } from 'vite'
export default defineConfig({
test: {
globals: true,
environment: 'happy-dom',
environment: 'jsdom',
},
})
2 changes: 1 addition & 1 deletion packages/vite-node/package.json
Expand Up @@ -73,7 +73,7 @@
"debug": "^4.3.4",
"mlly": "^0.5.16",
"pathe": "^0.2.0",
"vite": "^2.9.12 || ^3.0.0-0"
"vite": "^3.0.0"
},
"devDependencies": {
"@types/debug": "^4.1.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/package.json
Expand Up @@ -106,7 +106,7 @@
"tinybench": "^2.2.1",
"tinypool": "^0.3.0",
"tinyspy": "^1.0.2",
"vite": "^2.9.12 || ^3.0.0-0"
"vite": "^3.0.0"
},
"devDependencies": {
"@antfu/install-pkg": "^0.1.1",
Expand Down
34 changes: 26 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.