Skip to content

Commit 38bbfa0

Browse files
committed
chore: update vite e2e
1 parent b519626 commit 38bbfa0

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

e2e-test.js

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const os = require('os');
99
const fs = require('fs');
1010
const path = require('path');
1111
const test = require('ava');
12-
const puppeteer = require('puppeteer');
1312
const kill = require('tree-kill');
1413
const {possibleFeatureSelections} = require('makes');
1514
const questions = require('./questions');
@@ -85,15 +84,6 @@ function run(command, dataCB, errorCB) {
8584
});
8685
}
8786

88-
async function takeScreenshot(url, filePath) {
89-
const browser = await puppeteer.launch();
90-
const page = await browser.newPage();
91-
await page.goto(url);
92-
await new Promise(r => setTimeout(r, 6000));
93-
await page.screenshot({path: filePath});
94-
await browser.close();
95-
}
96-
9787
const targetFeatures = (process.env.TARGET_FEATURES || '').toLowerCase().split(',').filter(p => p);
9888
if (!targetFeatures.includes('playwright')) {
9989
targetFeatures.push('playwright');
@@ -111,7 +101,7 @@ if (targetFeatures.length) {
111101
function getServerRegex(features) {
112102
if (features.includes('webpack')) return /Loopback: (\S+)/;
113103
if (features.includes('parcel')) return /Server running at (\S+)/;
114-
if (features.includes('vite')) return /Local:\s+(\S+)/;
104+
if (features.includes('vite')) return /(http:\/\/\S+\/)/;
115105
return /Dev server is started at: (\S+)/;
116106
}
117107

@@ -164,18 +154,7 @@ skeletons.forEach((features, i) => {
164154
const m = data.toString().match(serverRegex);
165155
if (!m) return;
166156
const url = m[1];
167-
t.pass(m[0]);
168-
169-
try {
170-
if (!process.env.GITHUB_ACTIONS) {
171-
console.log('-- take screenshot');
172-
await takeScreenshot(url, path.join(folder, appName + '.png'));
173-
}
174-
kill();
175-
} catch (e) {
176-
t.fail(e.message);
177-
kill();
178-
}
157+
t.pass(m[0]); kill();
179158
};
180159

181160
// Webpack5 now prints Loopback: http://localhost:5000 in stderr!

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"glob": "^10.3.1",
1212
"makes": "^3.2.0",
1313
"npm-check-updates": "^16.10.13",
14-
"puppeteer": "^20.7.3",
1514
"semver": "^7.5.3",
1615
"standard-changelog": "^3.0.0",
1716
"tree-kill": "^1.2.2",

0 commit comments

Comments
 (0)