Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

Revert "chore(ct): type checking" (#18165)

Pavel Feldman7910f8a165cc
diff --git a/tests/components/ct-react-vite/package.json b/tests/components/ct-react-vite/package.json
index 4126048dbe..a2d9e02547 100644
--- a/tests/components/ct-react-vite/package.json
+++ b/tests/components/ct-react-vite/package.json
@@ -5,8 +5,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
- "preview": "vite preview",
- "typecheck": "tsc --noEmit"
+ "preview": "vite preview"
},
"dependencies": {
"react": "^17.0.2",
diff --git a/tests/components/ct-react-vite/tsconfig.json b/tests/components/ct-react-vite/tsconfig.json
index 3d0a51a86e..c8bdc64082 100644
--- a/tests/components/ct-react-vite/tsconfig.json
+++ b/tests/components/ct-react-vite/tsconfig.json
@@ -4,7 +4,7 @@
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
- "skipLibCheck": true,
+ "skipLibCheck": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
diff --git a/tests/components/ct-react/package.json b/tests/components/ct-react/package.json
index d7012b6af0..3d6fb76e13 100644
--- a/tests/components/ct-react/package.json
+++ b/tests/components/ct-react/package.json
@@ -18,8 +18,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
- "eject": "react-scripts eject",
- "typecheck": "tsc --noEmit"
+ "eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
diff --git a/tests/components/ct-react/src/tests.spec.tsx b/tests/components/ct-react/src/tests.spec.tsx
index 3f2eede57b..e53243871a 100644
--- a/tests/components/ct-react/src/tests.spec.tsx
+++ b/tests/components/ct-react/src/tests.spec.tsx
@@ -1,5 +1,5 @@
-import { test, expect } from '@playwright/experimental-ct-react';
-const { serverFixtures } = require('../../../../tests/config/serverFixtures');
+import { test, expect } from '@playwright/experimental-ct-react'
+import { serverFixtures } from '../../../../tests/config/serverFixtures';
import Fetch from './components/Fetch';
import DelayedData from './components/DelayedData';
import Button from './components/Button';
@@ -143,7 +143,7 @@ test('get textContent of the empty fragment', async ({ mount }) => {
const testWithServer = test.extend(serverFixtures);
testWithServer('components routing should go through context', async ({ mount, context, server }) => {
- server.setRoute('/hello', (req: any, res: any) => {
+ server.setRoute('/hello', (req, res) => {
res.write('served via server');
res.end();
});
@@ -158,7 +158,7 @@ testWithServer('components routing should go through context', async ({ mount, c
});
const whoServedTheRequest = Promise.race([
- server.waitForRequest('/hello').then((req: any) => `served via server: ${req.method} ${req.url}`),
+ server.waitForRequest('/hello').then((req) => `served via server: ${req.method} ${req.url}`),
routedViaContext.then(req => `served via context: ${req}`),
]);
diff --git a/tests/components/ct-solid/package.json b/tests/components/ct-solid/package.json
index cdcfbc7808..8176ee5f4b 100644
--- a/tests/components/ct-solid/package.json
+++ b/tests/components/ct-solid/package.json
@@ -6,8 +6,7 @@
"start": "vite",
"dev": "vite",
"build": "vite build",
- "serve": "vite preview",
- "typecheck": "tsc --noEmit"
+ "serve": "vite preview"
},
"license": "MIT",
"devDependencies": {
diff --git a/tests/components/ct-solid/tsconfig.json b/tests/components/ct-solid/tsconfig.json
index 9bb6e17684..249b2732a7 100644
--- a/tests/components/ct-solid/tsconfig.json
+++ b/tests/components/ct-solid/tsconfig.json
@@ -10,7 +10,6 @@
"jsxImportSource": "solid-js",
"types": ["vite/client"],
"noEmit": true,
- "isolatedModules": true,
- "skipLibCheck": true
+ "isolatedModules": true
}
}
diff --git a/tests/components/ct-svelte-vite/package.json b/tests/components/ct-svelte-vite/package.json
index 457a0fa989..1c3b967d94 100644
--- a/tests/components/ct-svelte-vite/package.json
+++ b/tests/components/ct-svelte-vite/package.json
@@ -7,7 +7,7 @@
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
- "typecheck": "svelte-check --tsconfig ./tsconfig.json"
+ "check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.1",
diff --git a/tests/components/ct-svelte-vite/src/components/Counter.svelte b/tests/components/ct-svelte-vite/src/components/Counter.svelte
index baf642fdcf..2b8a064b46 100644
--- a/tests/components/ct-svelte-vite/src/components/Counter.svelte
+++ b/tests/components/ct-svelte-vite/src/components/Counter.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import { update, remountCount } from '../store'
import { createEventDispatcher } from "svelte";
-export let count: number;
+export let count;
const dispatch = createEventDispatcher();
update();
</script>
diff --git a/tests/components/ct-svelte-vite/src/main.ts b/tests/components/ct-svelte-vite/src/main.ts
index 4e7ad898e9..ca8aaba9be 100644
--- a/tests/components/ct-svelte-vite/src/main.ts
+++ b/tests/components/ct-svelte-vite/src/main.ts
@@ -2,7 +2,7 @@ import App from './App.svelte';
import './assets/index.css';
const app = new App({
- target: document.getElementById('app')!
+ target: document.getElementById('app')
});
export default app;
diff --git a/tests/components/ct-svelte-vite/src/svelte.d.ts b/tests/components/ct-svelte-vite/src/svelte.d.ts
deleted file mode 100644
index 0fdb59facc..0000000000
--- a/tests/components/ct-svelte-vite/src/svelte.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module '*.svelte' {
- const value: any; // Add better type definitions here if desired.
- export default value;
-}
diff --git a/tests/components/ct-svelte-vite/src/tests.spec.ts b/tests/components/ct-svelte-vite/src/tests.spec.ts
index 6ebcc4ee03..e7cc19f220 100644
--- a/tests/components/ct-svelte-vite/src/tests.spec.ts
+++ b/tests/components/ct-svelte-vite/src/tests.spec.ts
@@ -65,13 +65,13 @@ test('renderer updates event listeners without remounting', async ({ mount }) =>
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(Button, {
props: {
title: 'Submit'
},
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
@@ -101,7 +101,7 @@ test('render a component with a named slot', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(Button, {
props: {
diff --git a/tests/components/ct-svelte-vite/tsconfig.json b/tests/components/ct-svelte-vite/tsconfig.json
index 898993ae64..4d6c04cf0a 100644
--- a/tests/components/ct-svelte-vite/tsconfig.json
+++ b/tests/components/ct-svelte-vite/tsconfig.json
@@ -13,10 +13,8 @@
* of JS in `.svelte` files.
*/
"allowJs": true,
- "checkJs": true,
- "skipLibCheck": true,
- "strict": true
+ "checkJs": true
},
- "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "src/**/*.spec.*/*"],
+ "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"],
"references": [{ "path": "./tsconfig.node.json" }]
}
diff --git a/tests/components/ct-svelte/package.json b/tests/components/ct-svelte/package.json
index 5a491ded3b..ef1144a34e 100644
--- a/tests/components/ct-svelte/package.json
+++ b/tests/components/ct-svelte/package.json
@@ -5,8 +5,7 @@
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
- "start": "sirv public --no-clear",
- "typecheck": "tsc --noEmit"
+ "start": "sirv public --no-clear"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
@@ -16,13 +15,13 @@
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
- "sirv-cli": "^2.0.0"
+ "svelte": "^3.0.0"
},
"@standaloneDevDependencies": {
"@playwright/experimental-ct-svelte": "^1.22.2",
"@playwright/test": "^1.22.2"
},
"dependencies": {
- "svelte": "^3.0.0"
+ "sirv-cli": "^2.0.0"
}
}
diff --git a/tests/components/ct-svelte/src/components/Counter.svelte b/tests/components/ct-svelte/src/components/Counter.svelte
index e850f3a35a..2b8a064b46 100644
--- a/tests/components/ct-svelte/src/components/Counter.svelte
+++ b/tests/components/ct-svelte/src/components/Counter.svelte
@@ -1,4 +1,4 @@
-<script>
+<script lang="ts">
import { update, remountCount } from '../store'
import { createEventDispatcher } from "svelte";
export let count;
diff --git a/tests/components/ct-svelte/src/tests.spec.ts b/tests/components/ct-svelte/src/tests.spec.ts
index 576b5c2acf..655beba19b 100644
--- a/tests/components/ct-svelte/src/tests.spec.ts
+++ b/tests/components/ct-svelte/src/tests.spec.ts
@@ -66,13 +66,13 @@ test('renderer updates event listeners without remounting', async ({ mount }) =>
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(Button, {
props: {
title: 'Submit'
},
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
@@ -107,7 +107,7 @@ test('render a component without options', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(Button, {
props: {
diff --git a/tests/components/ct-svelte/tsconfig.json b/tests/components/ct-svelte/tsconfig.json
deleted file mode 100644
index c3b167bbe8..0000000000
--- a/tests/components/ct-svelte/tsconfig.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "compilerOptions": {
- "target": "ESNext",
- "module": "ESNext",
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "strict": true,
- "skipLibCheck": true,
- "moduleResolution": "node"
- }
-}
diff --git a/tests/components/ct-vue-cli/.gitignore b/tests/components/ct-vue-cli/.gitignore
index 7e2a946d8e..11f5d71423 100644
--- a/tests/components/ct-vue-cli/.gitignore
+++ b/tests/components/ct-vue-cli/.gitignore
@@ -1,7 +1,6 @@
.DS_Store
node_modules
/dist
-*.tsbuildinfo
# local env files
.env.local
diff --git a/tests/components/ct-vue-cli/jsconfig.json b/tests/components/ct-vue-cli/jsconfig.json
new file mode 100644
index 0000000000..2f1dc80434
--- /dev/null
+++ b/tests/components/ct-vue-cli/jsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "jsx": "react-jsx",
+ "module": "esnext",
+ "baseUrl": "./",
+ "moduleResolution": "node",
+ "paths": {
+ "@/*": [
+ "src/*"
+ ]
+ },
+ "lib": [
+ "esnext",
+ "dom",
+ "dom.iterable",
+ "scripthost"
+ ]
+ }
+}
diff --git a/tests/components/ct-vue-cli/package.json b/tests/components/ct-vue-cli/package.json
index e2990f0f21..e260488047 100644
--- a/tests/components/ct-vue-cli/package.json
+++ b/tests/components/ct-vue-cli/package.json
@@ -5,8 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
- "lint": "vue-cli-service lint",
- "typecheck": "tsc --noEmit --project tsconfig.test.json"
+ "lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
@@ -18,7 +17,6 @@
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
- "@vue/tsconfig": "^0.1.3",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3"
},
diff --git a/tests/components/ct-vue-cli/src/components/Button.vue b/tests/components/ct-vue-cli/src/components/Button.vue
index f597f2803d..334a3d0364 100644
--- a/tests/components/ct-vue-cli/src/components/Button.vue
+++ b/tests/components/ct-vue-cli/src/components/Button.vue
@@ -1,4 +1,4 @@
-<script lang="ts" setup>
+<script setup>
defineProps({
title: {
type: String,
diff --git a/tests/components/ct-vue-cli/src/components/Counter.vue b/tests/components/ct-vue-cli/src/components/Counter.vue
index 29ed704343..6e211660b7 100644
--- a/tests/components/ct-vue-cli/src/components/Counter.vue
+++ b/tests/components/ct-vue-cli/src/components/Counter.vue
@@ -5,11 +5,11 @@
</div>
</template>
-<script lang="ts">
+<script>
let remountCount = 0
</script>
-<script lang="ts" setup>
+<script setup>
defineProps({
count: {
type: Number,
diff --git a/tests/components/ct-vue-cli/src/notation-jsx.spec.tsx b/tests/components/ct-vue-cli/src/notation-jsx.spec.tsx
index b21002e3cc..43eb2c69b7 100644
--- a/tests/components/ct-vue-cli/src/notation-jsx.spec.tsx
+++ b/tests/components/ct-vue-cli/src/notation-jsx.spec.tsx
@@ -28,13 +28,10 @@ test('renderer and keep the component instance intact', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
- const component = await mount(<Button
- title="Submit"
- v-on:submit={(data: string) => {
- messages.push(data)
- }}
- />)
+ const messages = []
+ const component = await mount(<Button title='Submit' v-on:submit={data => {
+ messages.push(data)
+ }}></Button>)
await component.click()
expect(messages).toEqual(['hello'])
})
@@ -82,7 +79,7 @@ test('emit a event when a slot is clicked', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(<Button title="Submit" />, {
hooksConfig: { route: 'A' }
diff --git a/tests/components/ct-vue-cli/src/notation-vue.spec.ts b/tests/components/ct-vue-cli/src/notation-vue.spec.ts
index 2ba1be9ba3..10d4fd21ae 100644
--- a/tests/components/ct-vue-cli/src/notation-vue.spec.ts
+++ b/tests/components/ct-vue-cli/src/notation-vue.spec.ts
@@ -1,4 +1,5 @@
import { test, expect } from '@playwright/experimental-ct-vue'
+
import Button from './components/Button.vue'
import Counter from './components/Counter.vue'
import DefaultSlot from './components/DefaultSlot.vue'
@@ -37,13 +38,13 @@ test('renderer and keep the component instance intact', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(Button, {
props: {
title: 'Submit'
},
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
@@ -88,7 +89,7 @@ test('render a component without options', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(Button, {
props: {
diff --git a/tests/components/ct-vue-cli/tsconfig.app.json b/tests/components/ct-vue-cli/tsconfig.app.json
deleted file mode 100644
index 326d9a3552..0000000000
--- a/tests/components/ct-vue-cli/tsconfig.app.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.web.json",
- "include": ["src/**/*", "src/**/*.vue"],
- "exclude": ["src/**/*.spec.*/*"],
- "compilerOptions": {
- "composite": true,
- "baseUrl": ".",
- "paths": {
- "@/*": ["./src/*"]
- }
- }
-}
diff --git a/tests/components/ct-vue-cli/tsconfig.config.json b/tests/components/ct-vue-cli/tsconfig.config.json
deleted file mode 100644
index d554caf51b..0000000000
--- a/tests/components/ct-vue-cli/tsconfig.config.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.node.json",
- "include": ["playwright.config.*"],
- "compilerOptions": {
- "composite": true,
- "types": ["node"]
- }
-}
diff --git a/tests/components/ct-vue-cli/tsconfig.json b/tests/components/ct-vue-cli/tsconfig.json
deleted file mode 100644
index 536e033e83..0000000000
--- a/tests/components/ct-vue-cli/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "files": [],
- "references": [
- {
- "path": "./tsconfig.config.json"
- },
- {
- "path": "./tsconfig.app.json"
- },
- {
- "path": "./tsconfig.test.json"
- }
- ]
-}
diff --git a/tests/components/ct-vue-cli/tsconfig.test.json b/tests/components/ct-vue-cli/tsconfig.test.json
deleted file mode 100644
index afdab7de21..0000000000
--- a/tests/components/ct-vue-cli/tsconfig.test.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "./tsconfig.app.json",
- "exclude": [],
- "compilerOptions": {
- "composite": true,
- "lib": [],
- "jsx": "react-jsx",
- "types": ["node"]
- }
-}
diff --git a/tests/components/ct-vue-cli/vue.d.ts b/tests/components/ct-vue-cli/vue.d.ts
deleted file mode 100644
index d4d073050e..0000000000
--- a/tests/components/ct-vue-cli/vue.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module '*.vue' {
- const value: any;
- export default value;
-}
diff --git a/tests/components/ct-vue-vite/.gitignore b/tests/components/ct-vue-vite/.gitignore
index 0f4b1c5632..7cc64f4ee4 100644
--- a/tests/components/ct-vue-vite/.gitignore
+++ b/tests/components/ct-vue-vite/.gitignore
@@ -6,7 +6,6 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
-*.tsbuildinfo
node_modules
.DS_Store
diff --git a/tests/components/ct-vue-vite/env.d.ts b/tests/components/ct-vue-vite/env.d.ts
deleted file mode 100644
index 11f02fe2a0..0000000000
--- a/tests/components/ct-vue-vite/env.d.ts
+++ /dev/null
@@ -1 +0,0 @@
-/// <reference types="vite/client" />
diff --git a/tests/components/ct-vue-vite/package.json b/tests/components/ct-vue-vite/package.json
index 55633afba1..c2ceb077f9 100644
--- a/tests/components/ct-vue-vite/package.json
+++ b/tests/components/ct-vue-vite/package.json
@@ -4,17 +4,14 @@
"scripts": {
"dev": "vite",
"build": "vite build",
- "preview": "vite preview --port 5050",
- "typecheck": "vue-tsc --noEmit --project tsconfig.test.json"
+ "preview": "vite preview --port 5050"
},
"dependencies": {
"vue": "^3.2.31"
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.2.2",
- "@vue/tsconfig": "^0.1.3",
- "vite": "^2.8.4",
- "vue-tsc": "^1.0.0"
+ "vite": "^2.8.4"
},
"@standaloneDevDependencies": {
"@playwright/experimental-ct-vue": "^1.22.2",
diff --git a/tests/components/ct-vue-vite/src/components/Button.vue b/tests/components/ct-vue-vite/src/components/Button.vue
index ecd53ed284..334a3d0364 100644
--- a/tests/components/ct-vue-vite/src/components/Button.vue
+++ b/tests/components/ct-vue-vite/src/components/Button.vue
@@ -1,5 +1,10 @@
-<script lang="ts" setup>
- defineProps<{ title: string }>()
+<script setup>
+defineProps({
+ title: {
+ type: String,
+ required: true
+ }
+})
</script>
<template>
diff --git a/tests/components/ct-vue-vite/src/components/Counter.vue b/tests/components/ct-vue-vite/src/components/Counter.vue
index 9c9fe4009f..a2c6f4c82e 100644
--- a/tests/components/ct-vue-vite/src/components/Counter.vue
+++ b/tests/components/ct-vue-vite/src/components/Counter.vue
@@ -7,13 +7,17 @@
</div>
</template>
-<script lang="ts">
+<script>
let remountCount = 0
</script>
-<script lang="ts" setup>
-defineProps<{ count?: number }>()
-
+<script setup>
+defineProps({
+ count: {
+ type: Number,
+ required: false
+ }
+})
remountCount++
</script>
diff --git a/tests/components/ct-vue-vite/src/components/NamedSlots.vue b/tests/components/ct-vue-vite/src/components/NamedSlots.vue
index 582608df32..b7e95f4487 100644
--- a/tests/components/ct-vue-vite/src/components/NamedSlots.vue
+++ b/tests/components/ct-vue-vite/src/components/NamedSlots.vue
@@ -3,6 +3,7 @@
<header>
<slot name="header" />
</header>
+
<main>
<slot name="main" />
</main>
diff --git a/tests/components/ct-vue-vite/src/notation-jsx.spec.tsx b/tests/components/ct-vue-vite/src/notation-jsx.spec.tsx
index 63569e5849..86501606bb 100644
--- a/tests/components/ct-vue-vite/src/notation-jsx.spec.tsx
+++ b/tests/components/ct-vue-vite/src/notation-jsx.spec.tsx
@@ -33,9 +33,8 @@ test('renderer updates props without remounting', async ({ mount }) => {
test('renderer updates event listeners without remounting', async ({ mount }) => {
const component = await mount(<Counter />)
-
- const messages: string[] = []
- await component.update(<Counter v-on:submit={(count: string) => {
+ const messages = []
+ await component.update(<Counter v-on:submit={count => {
messages.push(count)
}} />)
await component.click();
@@ -58,13 +57,10 @@ test('renderer updates slots without remounting', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
- const component = await mount(<Button
- title="Submit"
- v-on:submit={(data: string) => {
- messages.push(data)
- }}
- />)
+ const messages = []
+ const component = await mount(<Button title='Submit' v-on:submit={data => {
+ messages.push(data)
+ }}></Button>)
await component.click()
expect(messages).toEqual(['hello'])
})
@@ -112,7 +108,7 @@ test('emit a event when a slot is clicked', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(<Button title="Submit" />, {
hooksConfig: { route: 'A' }
@@ -122,9 +118,12 @@ test('run hooks', async ({ page, mount }) => {
test('unmount a multi root component', async ({ mount, page }) => {
const component = await mount(<MultiRoot />)
+
await expect(page.locator('#root')).toContainText('root 1')
await expect(page.locator('#root')).toContainText('root 2')
+
await component.unmount()
+
await expect(page.locator('#root')).not.toContainText('root 1')
await expect(page.locator('#root')).not.toContainText('root 2')
})
diff --git a/tests/components/ct-vue-vite/src/notation-vue.spec.js b/tests/components/ct-vue-vite/src/notation-vue.spec.js
index 316635c478..95aaefce87 100644
--- a/tests/components/ct-vue-vite/src/notation-vue.spec.js
+++ b/tests/components/ct-vue-vite/src/notation-vue.spec.js
@@ -40,7 +40,7 @@ test('renderer updates event listeners without remounting', async ({ mount }) =>
const messages = []
await component.update({
on: {
- submit: (count) => messages.push(count)
+ submit: count => messages.push(count)
}
})
await component.click();
@@ -71,7 +71,7 @@ test('emit an submit event when the button is clicked', async ({ mount }) => {
title: 'Submit'
},
on: {
- submit: (data) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
diff --git a/tests/components/ct-vue-vite/src/notation-vue.spec.ts b/tests/components/ct-vue-vite/src/notation-vue.spec.ts
index abf3f5e0e4..94c2565620 100644
--- a/tests/components/ct-vue-vite/src/notation-vue.spec.ts
+++ b/tests/components/ct-vue-vite/src/notation-vue.spec.ts
@@ -38,10 +38,10 @@ test('renderer updates props without remounting', async ({ mount }) => {
test('renderer updates event listeners without remounting', async ({ mount }) => {
const component = await mount(Counter)
- const messages: string[] = []
+ const messages = []
await component.update({
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click();
@@ -66,13 +66,13 @@ test('renderer updates slots without remounting', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(Button, {
props: {
title: 'Submit'
},
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
@@ -120,7 +120,7 @@ test('render a component without options', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<HooksConfig>(Button, {
props: {
@@ -144,9 +144,12 @@ test('unmount', async ({ page, mount }) => {
test('unmount a multi root component', async ({ mount, page }) => {
const component = await mount(MultiRoot)
+
await expect(page.locator('#root')).toContainText('root 1')
await expect(page.locator('#root')).toContainText('root 2')
+
await component.unmount()
+
await expect(page.locator('#root')).not.toContainText('root 1')
await expect(page.locator('#root')).not.toContainText('root 2')
})
diff --git a/tests/components/ct-vue-vite/tsconfig.app.json b/tests/components/ct-vue-vite/tsconfig.app.json
deleted file mode 100644
index be8aaad0f1..0000000000
--- a/tests/components/ct-vue-vite/tsconfig.app.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.web.json",
- "include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
- "exclude": ["src/**/*.spec.*/*"],
- "compilerOptions": {
- "composite": true,
- "baseUrl": ".",
- "paths": {
- "@/*": ["./src/*"]
- }
- }
-}
diff --git a/tests/components/ct-vue-vite/tsconfig.config.json b/tests/components/ct-vue-vite/tsconfig.config.json
deleted file mode 100644
index 75f02c4939..0000000000
--- a/tests/components/ct-vue-vite/tsconfig.config.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.node.json",
- "include": ["vite.config.*", "playwright.config.*"],
- "compilerOptions": {
- "composite": true,
- "types": ["node"]
- }
-}
diff --git a/tests/components/ct-vue-vite/tsconfig.json b/tests/components/ct-vue-vite/tsconfig.json
deleted file mode 100644
index 536e033e83..0000000000
--- a/tests/components/ct-vue-vite/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "files": [],
- "references": [
- {
- "path": "./tsconfig.config.json"
- },
- {
- "path": "./tsconfig.app.json"
- },
- {
- "path": "./tsconfig.test.json"
- }
- ]
-}
diff --git a/tests/components/ct-vue-vite/tsconfig.test.json b/tests/components/ct-vue-vite/tsconfig.test.json
deleted file mode 100644
index af80b6d75b..0000000000
--- a/tests/components/ct-vue-vite/tsconfig.test.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": "./tsconfig.app.json",
- "exclude": [],
- "compilerOptions": {
- "composite": true,
- "lib": [],
- "types": ["node"]
- }
-}
diff --git a/tests/components/ct-vue-vite/vue.d.ts b/tests/components/ct-vue-vite/vue.d.ts
new file mode 100644
index 0000000000..df9f4ba885
--- /dev/null
+++ b/tests/components/ct-vue-vite/vue.d.ts
@@ -0,0 +1 @@
+declare module '*.vue';
diff --git a/tests/components/ct-vue2-cli/.gitignore b/tests/components/ct-vue2-cli/.gitignore
index 7e2a946d8e..403adbc1e5 100644
--- a/tests/components/ct-vue2-cli/.gitignore
+++ b/tests/components/ct-vue2-cli/.gitignore
@@ -1,7 +1,7 @@
.DS_Store
node_modules
/dist
-*.tsbuildinfo
+
# local env files
.env.local
diff --git a/tests/components/ct-vue2-cli/package.json b/tests/components/ct-vue2-cli/package.json
index 17c4f707df..11fedb66eb 100644
--- a/tests/components/ct-vue2-cli/package.json
+++ b/tests/components/ct-vue2-cli/package.json
@@ -5,8 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
- "lint": "vue-cli-service lint",
- "typecheck": "tsc --noEmit --project tsconfig.test.json"
+ "lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.8.3",
@@ -18,7 +17,6 @@
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
- "@vue/tsconfig": "^0.1.3",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"vue-template-compiler": "^2.6.14"
diff --git a/tests/components/ct-vue2-cli/src/components/Button.vue b/tests/components/ct-vue2-cli/src/components/Button.vue
index 8bf2f3b71b..bf008d3f7c 100644
--- a/tests/components/ct-vue2-cli/src/components/Button.vue
+++ b/tests/components/ct-vue2-cli/src/components/Button.vue
@@ -2,7 +2,7 @@
<button @click="$emit('submit', 'hello')">{{ title }}</button>
</template>
-<script lang="ts">
+<script>
export default {
name: 'ButtonButton',
props: ['title']
diff --git a/tests/components/ct-vue2-cli/src/components/Counter.vue b/tests/components/ct-vue2-cli/src/components/Counter.vue
index bc3269bf36..9998a6cb85 100644
--- a/tests/components/ct-vue2-cli/src/components/Counter.vue
+++ b/tests/components/ct-vue2-cli/src/components/Counter.vue
@@ -7,7 +7,7 @@
</div>
</template>
-<script lang="ts">
+<script>
let remountCount = 0;
export default {
diff --git a/tests/components/ct-vue2-cli/src/components/HelloWorld.vue b/tests/components/ct-vue2-cli/src/components/HelloWorld.vue
index 2b04639e8b..879051a297 100644
--- a/tests/components/ct-vue2-cli/src/components/HelloWorld.vue
+++ b/tests/components/ct-vue2-cli/src/components/HelloWorld.vue
@@ -30,7 +30,7 @@
</div>
</template>
-<script lang="ts">
+<script>
export default {
name: 'HelloWorld',
props: {
diff --git a/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx b/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx
index 087d96b31e..575d1198cb 100644
--- a/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx
+++ b/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx
@@ -30,14 +30,12 @@ test('renderer updates props without remounting', async ({ mount }) => {
})
test('renderer updates event listeners without remounting', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(<Counter />)
- await component.update(<Counter
- v-on:submit={(count: string) => {
- messages.push(count)
- }}
- />)
+ await component.update(<Counter v-on:submit={count => {
+ messages.push(count)
+ }} />)
await component.click();
expect(messages).toEqual(['hello'])
@@ -58,13 +56,10 @@ test('renderer updates slots without remounting', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
- const component = await mount(<Button
- title="Submit"
- v-on:submit={(data: string) => {
- messages.push(data)
- }}
- />)
+ const messages = []
+ const component = await mount(<Button title='Submit' v-on:submit={data => {
+ messages.push(data)
+ }}></Button>)
await component.click()
expect(messages).toEqual(['hello'])
})
@@ -112,7 +107,7 @@ test('emit a event when a slot is clicked', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<hooksConfig>(<Button title="Submit" />, {
hooksConfig: { route: 'A' }
diff --git a/tests/components/ct-vue2-cli/src/notation-vue.spec.ts b/tests/components/ct-vue2-cli/src/notation-vue.spec.ts
index 515399be8a..c5a9ca0867 100644
--- a/tests/components/ct-vue2-cli/src/notation-vue.spec.ts
+++ b/tests/components/ct-vue2-cli/src/notation-vue.spec.ts
@@ -36,10 +36,10 @@ test('renderer updates props without remounting', async ({ mount }) => {
test('renderer updates event listeners without remounting', async ({ mount }) => {
const component = await mount(Counter)
- const messages: string[] = []
+ const messages = []
await component.update({
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click();
@@ -70,13 +70,13 @@ test('renderer updates slots without remounting', async ({ mount }) => {
})
test('emit an submit event when the button is clicked', async ({ mount }) => {
- const messages: string[] = []
+ const messages = []
const component = await mount(Button, {
props: {
title: 'Submit'
},
on: {
- submit: (data: string) => messages.push(data)
+ submit: data => messages.push(data)
}
})
await component.click()
@@ -121,7 +121,7 @@ test('render a component without options', async ({ mount }) => {
})
test('run hooks', async ({ page, mount }) => {
- const messages: string[] = []
+ const messages = []
page.on('console', m => messages.push(m.text()))
await mount<hooksConfig>(Button, {
props: {
diff --git a/tests/components/ct-vue2-cli/src/shims-vue.d.ts b/tests/components/ct-vue2-cli/src/shims-vue.d.ts
deleted file mode 100644
index 8f6f410263..0000000000
--- a/tests/components/ct-vue2-cli/src/shims-vue.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-declare module '*.vue' {
- import Vue from 'vue';
- export default Vue;
-}
diff --git a/tests/components/ct-vue2-cli/src/vue.d.ts b/tests/components/ct-vue2-cli/src/vue.d.ts
new file mode 100644
index 0000000000..df9f4ba885
--- /dev/null
+++ b/tests/components/ct-vue2-cli/src/vue.d.ts
@@ -0,0 +1 @@
+declare module '*.vue';
diff --git a/tests/components/ct-vue2-cli/tsconfig.app.json b/tests/components/ct-vue2-cli/tsconfig.app.json
deleted file mode 100644
index 326d9a3552..0000000000
--- a/tests/components/ct-vue2-cli/tsconfig.app.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.web.json",
- "include": ["src/**/*", "src/**/*.vue"],
- "exclude": ["src/**/*.spec.*/*"],
- "compilerOptions": {
- "composite": true,
- "baseUrl": ".",
- "paths": {
- "@/*": ["./src/*"]
- }
- }
-}
diff --git a/tests/components/ct-vue2-cli/tsconfig.config.json b/tests/components/ct-vue2-cli/tsconfig.config.json
deleted file mode 100644
index d554caf51b..0000000000
--- a/tests/components/ct-vue2-cli/tsconfig.config.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "@vue/tsconfig/tsconfig.node.json",
- "include": ["playwright.config.*"],
- "compilerOptions": {
- "composite": true,
- "types": ["node"]
- }
-}
diff --git a/tests/components/ct-vue2-cli/tsconfig.json b/tests/components/ct-vue2-cli/tsconfig.json
deleted file mode 100644
index 536e033e83..0000000000
--- a/tests/components/ct-vue2-cli/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "files": [],
- "references": [
- {
- "path": "./tsconfig.config.json"
- },
- {
- "path": "./tsconfig.app.json"
- },
- {
- "path": "./tsconfig.test.json"
- }
- ]
-}
diff --git a/tests/components/ct-vue2-cli/tsconfig.test.json b/tests/components/ct-vue2-cli/tsconfig.test.json
deleted file mode 100644
index af80b6d75b..0000000000
--- a/tests/components/ct-vue2-cli/tsconfig.test.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "extends": "./tsconfig.app.json",
- "exclude": [],
- "compilerOptions": {
- "composite": true,
- "lib": [],
- "types": ["node"]
- }
-}
diff --git a/tests/components/test-all.spec.js b/tests/components/test-all.spec.js
index 98fba8d9a2..bdd2ba6a67 100644
--- a/tests/components/test-all.spec.js
+++ b/tests/components/test-all.spec.js
@@ -14,15 +14,11 @@ for (const dir of fs.readdirSync(__dirname)) {
await run('npm', ['i'], folder);
});
- test('typecheck', async () => {
- await run('npm', ['run', 'typecheck'], folder);
- });
-
for (const project of ['chromium', 'firefox', 'webkit']) {
test(project, async () => {
await run('npx', ['playwright', 'test', '--project=' + project, '--reporter=list'], folder);
});
- }
+ }
});
}