Skip to content

Commit d96e05f

Browse files
committed
🧪 Restructure SDK E2E tests to match real user workflow
E2E tests now run the actual CLI commands like users would: - Storybook: `vizzly storybook ./example-storybook/dist` - Static-site: `vizzly static-site ../../test-site` Old SDK integration tests renamed to sdk-integration.test.js and moved to separate test:sdk-integration script. Added .vizzlyrc.js for local dev plugin loading, and updated both plugins to use new vizzlyPlugin field.
1 parent c799f2f commit d96e05f

6 files changed

Lines changed: 46 additions & 14 deletions

File tree

clients/static-site/.vizzlyrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Vizzly config for Static-Site SDK development
3+
*
4+
* This config explicitly loads the local plugin since it's not installed
5+
* in node_modules during development.
6+
*/
7+
export default {
8+
// Load the local plugin directly
9+
plugins: ['./dist/plugin.js'],
10+
11+
// Default static-site config for E2E tests
12+
staticSite: {
13+
viewports: [{ name: 'default', width: 1280, height: 720 }],
14+
concurrency: 3,
15+
browser: {
16+
headless: true,
17+
},
18+
},
19+
};

clients/static-site/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
}
3232
},
3333
"main": "./dist/index.js",
34-
"vizzly": {
35-
"plugin": "./dist/plugin.js"
36-
},
34+
"vizzlyPlugin": "./dist/plugin.js",
3735
"files": [
3836
"dist",
3937
"README.md",
@@ -45,10 +43,9 @@
4543
"clean": "rimraf dist",
4644
"compile": "babel src --out-dir dist --ignore '**/*.test.js'",
4745
"prepublishOnly": "npm run lint && npm run build",
48-
"test": "node --test --test-reporter=spec $(find tests -name '*.test.js' ! -name 'e2e.test.js')",
49-
"test:e2e": "VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js",
50-
"test:e2e:tdd": "../../bin/vizzly.js tdd run 'VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js'",
51-
"test:e2e:cloud": "../../bin/vizzly.js run 'VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js'",
46+
"test": "node --test --test-reporter=spec $(find tests -name '*.test.js' ! -name 'sdk-integration.test.js')",
47+
"test:sdk-integration": "VIZZLY_E2E=1 node --test --test-reporter=spec tests/sdk-integration.test.js",
48+
"test:e2e": "../../bin/vizzly.js static-site ../../test-site",
5249
"test:watch": "node --test --test-reporter=spec --watch $(find tests -name '*.test.js')",
5350
"lint": "biome lint src",
5451
"lint:fix": "biome lint --write src",
File renamed without changes.

clients/storybook/.vizzlyrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Vizzly config for Storybook SDK development
3+
*
4+
* This config explicitly loads the local plugin since it's not installed
5+
* in node_modules during development.
6+
*/
7+
export default {
8+
// Load the local plugin directly
9+
plugins: ['./dist/plugin.js'],
10+
11+
// Default storybook config for E2E tests
12+
storybook: {
13+
viewports: [{ name: 'default', width: 1280, height: 720 }],
14+
concurrency: 3,
15+
browser: {
16+
headless: true,
17+
},
18+
},
19+
};

clients/storybook/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
}
2828
},
2929
"main": "./dist/index.js",
30-
"vizzly": {
31-
"plugin": "./dist/plugin.js"
32-
},
30+
"vizzlyPlugin": "./dist/plugin.js",
3331
"files": [
3432
"dist",
3533
"README.md",
@@ -41,10 +39,9 @@
4139
"clean": "rimraf dist",
4240
"compile": "babel src --out-dir dist --ignore '**/*.test.js'",
4341
"prepublishOnly": "npm run lint && npm run build",
44-
"test": "node --test --test-reporter=spec $(find tests -name '*.test.js' ! -name 'e2e.test.js')",
45-
"test:e2e": "VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js",
46-
"test:e2e:tdd": "../../bin/vizzly.js tdd run 'VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js'",
47-
"test:e2e:cloud": "../../bin/vizzly.js run 'VIZZLY_E2E=1 node --test --test-reporter=spec tests/e2e.test.js'",
42+
"test": "node --test --test-reporter=spec $(find tests -name '*.test.js' ! -name 'sdk-integration.test.js')",
43+
"test:sdk-integration": "VIZZLY_E2E=1 node --test --test-reporter=spec tests/sdk-integration.test.js",
44+
"test:e2e": "../../bin/vizzly.js storybook ./example-storybook/dist",
4845
"test:watch": "node --test --test-reporter=spec --watch 'tests/**/*.test.js'",
4946
"lint": "biome lint src tests",
5047
"lint:fix": "biome lint --write src tests",
File renamed without changes.

0 commit comments

Comments
 (0)