Skip to content

Commit 34de2d0

Browse files
committed
+svelte
1 parent 0e030ed commit 34de2d0

26 files changed

+213
-665
lines changed

libraries/__shared__/tests/advanced-tests.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ import {getProp, each, weight} from "./util";
2020

2121

2222
each(() => {
23-
test.describe('advanced support', weight(2), () => {
23+
test.describe('advanced support', weight(2), () => {
2424
test.describe('attributes and properties', () => {
2525
test('will pass array data as a property', async ({page}) => {
2626
const ce = page.locator('#ce-with-properties');
27-
expect(await getProp(ce, 'arr')).toEqual(['R', 'e', 'a', 'c', 't'])
27+
expect(await getProp(ce, 'arr')).toEqual(['c', 'u', 's', 't', 'o', 'm'])
2828
})
2929

3030
test('will pass object data as a property', async ({page}) => {
3131
const ce = page.locator('#ce-with-properties');
32-
expect(await getProp(ce, 'obj')).toEqual({org: "facebook", repo: "react"})
32+
expect(await getProp(ce, 'obj')).toEqual({org: 'webcomponents', repo: 'custom-elements-everywhere'})
3333
})
3434

3535
test("will pass object data to a camelCase-named property", async ({page}) => {

libraries/__shared__/tests/basic-tests.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ each(() => {
7070

7171
test("will pass string data as either an attribute or a property", async ({page}) => {
7272
const ce = page.locator('#ce-with-properties');
73-
expect(await getPropOrAttr(ce, 'str')).toEqual("React")
73+
expect(await getPropOrAttr(ce, 'str')).toEqual("custom")
7474
});
7575
});
7676

libraries/__shared__/tests/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"license": "ISC",
77
"private": true,
88
"scripts": {
9+
"serve": "http-server harness",
910
"test": "wireit"
1011
},
1112
"devDependencies": {
@@ -15,7 +16,8 @@
1516
"wireit": {
1617
"test": {
1718
"dependencies": [
18-
"../../react:build"
19+
"../../react:build",
20+
"../../svelte:build"
1921
],
2022
"files": [
2123
"advanced-tests.test.js",

libraries/__shared__/tests/playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default defineConfig({
1515
},
1616
],
1717
webServer: {
18-
command: 'pnpm http-server harness',
18+
command: 'pnpm serve',
1919
url: 'http://localhost:8080',
2020
reuseExistingServer: !process.env.CI,
2121
stdout: 'ignore',

libraries/react/src/components.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export const ComponentWithProperties = () => {
6666
const data = {
6767
bool: true,
6868
num: 42,
69-
str: 'React',
70-
arr: ['R', 'e', 'a', 'c', 't'],
71-
obj: {org: 'facebook', repo: 'react'},
69+
str: 'custom',
70+
arr: ['c', 'u', 's', 't', 'o', 'm'],
71+
obj: { org: 'webcomponents', repo: 'custom-elements-everywhere' },
7272
camelCaseObj: {label: "passed"}
7373
};
7474
return (
@@ -90,9 +90,9 @@ export const ComponentWithUnregistered = () => {
9090
const data = {
9191
bool: true,
9292
num: 42,
93-
str: 'React',
94-
arr: ['R', 'e', 'a', 'c', 't'],
95-
obj: {org: 'facebook', repo: 'react'}
93+
str: 'custom',
94+
arr: ['c', 'u', 's', 't', 'o', 'm'],
95+
obj: { org: 'webcomponents', repo: 'custom-elements-everywhere' }
9696
};
9797
return (
9898
<div>

libraries/react/tests.webpack.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

libraries/svelte/.babelrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

libraries/svelte/karma.conf.js

Lines changed: 0 additions & 91 deletions
This file was deleted.

libraries/svelte/package.json

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,16 @@
55
},
66
"library_repo": "sveltejs/svelte",
77
"devDependencies": {
8-
"@babel/core": "7.28.0",
9-
"@babel/plugin-transform-runtime": "7.28.0",
10-
"@babel/preset-env": "7.28.0",
11-
"babel-loader": "9.2.1",
12-
"chai": "4.5.0",
13-
"copy-webpack-plugin": "11.0.0",
14-
"cross-env": "7.0.3",
15-
"karma": "6.4.4",
16-
"karma-chrome-launcher": "3.2.0",
17-
"karma-firefox-launcher": "2.1.3",
18-
"karma-sourcemap-loader": "0.4.0",
19-
"karma-webpack": "5.0.1",
20-
"svelte-loader": "3.2.4",
21-
"webpack": "5.101.0"
8+
"vite": "^7.2.2",
9+
"@sveltejs/vite-plugin-svelte": "^6.2.1"
2210
},
2311
"dependencies": {
24-
"svelte": "4.2.19"
12+
"svelte": "^5.43.4",
13+
"wc": "workspace:*"
2514
},
2615
"wireit": {
27-
"test": {
28-
"dependencies": [
29-
"../..:karma-plugins"
30-
],
31-
"files": [
32-
".babelrc",
33-
"karma.conf.js",
34-
"tests.webpack.js",
35-
"src",
36-
"meta"
37-
],
38-
"output": [
39-
"results"
40-
],
41-
"command": "cross-env LIBRARY_NAME=svelte karma start || echo ''"
42-
},
4316
"build": {
44-
"dependencies": [
45-
"test"
46-
]
17+
"command": "vite build"
4718
}
4819
}
4920
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<script module>
2+
import 'wc/ce-without-children';
3+
import 'wc/ce-with-children';
4+
import 'wc/ce-with-properties';
5+
import 'wc/ce-with-event';
6+
7+
import ComponentWithoutChildren from './components/ComponentWithoutChildren.svelte';
8+
import ComponentWithChildren from './components/ComponentWithChildren.svelte';
9+
import ComponentWithChildrenRerender from './components/ComponentWithChildrenRerender.svelte';
10+
import ComponentWithDifferentViews from './components/ComponentWithDifferentViews.svelte';
11+
import ComponentWithProperties from './components/ComponentWithProperties.svelte';
12+
import ComponentWithImperativeEvent from './components/ComponentWithImperativeEvent.svelte';
13+
import ComponentWithDeclarativeEvent from './components/ComponentWithDeclarativeEvent.svelte';
14+
</script>
15+
16+
17+
<ComponentWithoutChildren/>
18+
<ComponentWithChildren/>
19+
<ComponentWithChildrenRerender/>
20+
<ComponentWithDifferentViews/>
21+
<ComponentWithProperties/>
22+
<ComponentWithDeclarativeEvent/>
23+
<ComponentWithImperativeEvent />

0 commit comments

Comments
 (0)