Skip to content

Commit 8322248

Browse files
committed
test: improve skeleton e2e tests
1 parent 9c63cbd commit 8322248

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

e2e-test.js

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function killProc(proc) {
2727
const dir = __dirname;
2828

2929
const folder = path.join(dir, 'test-skeletons');
30+
console.log('-- cleanup ' + folder);
3031
del.sync(folder);
3132
fs.mkdirSync(folder);
3233

@@ -78,29 +79,13 @@ async function takeScreenshot(url, filePath) {
7879
await browser.close();
7980
}
8081

81-
// don't test shadow-dom-closed, it's not testable by cypress.
82-
const skeletons = [
83-
'webpack cypress',
84-
'webpack shadow-dom-open cypress',
85-
'webpack css-module cypress',
86-
'webpack typescript cypress',
87-
'webpack typescript shadow-dom-closed cypress',
88-
'webpack typescript css-module cypress',
89-
90-
'dumber cypress',
91-
'dumber shadow-dom-closed cypress',
92-
'dumber css-module cypress',
93-
'dumber typescript cypress',
94-
'dumber typescript shadow-dom-open cypress',
95-
'dumber typescript css-module cypress',
96-
97-
// 'parcel cypress',
98-
// 'parcel typescript cypress',
99-
// 'browserify cypress',
100-
// 'browserify typescript cypress',
101-
// 'fuse-box cypress',
102-
// 'fuse-box typescript cypress',
103-
];
82+
const targetBundler = (process.env.TARGET_BUNDLER || 'webpack').toLowerCase();
83+
console.log('-- Target bundler: ' + targetBundler);
84+
const transpilers = ['babel', 'typescript'];
85+
const cssModes = ['', 'shadow-dom-open', 'shadow-dom-closed', 'css-module'];
86+
const cssProcessors = ['css', 'sass', 'less'];
87+
const testFrameworks = ['jasmine', 'tape', 'mocha'];
88+
const e2eFrameworks = ['cypress'];
10489

10590
function getServerRegex(features) {
10691
if (features.includes('webpack')) return /Project is running at (\S+)/;
@@ -115,8 +100,20 @@ function getStartCommand(features) {
115100
return 'npm start';
116101
}
117102

118-
skeletons.forEach((_f, i) => {
119-
const features = _f.split(' ');
103+
const skeletons = [];
104+
transpilers.forEach(transpiler => {
105+
cssModes.forEach(cssMode => {
106+
cssProcessors.forEach(cssProcessor => {
107+
testFrameworks.forEach(testFramework => {
108+
e2eFrameworks.forEach(e2eFramework => {
109+
skeletons.push([targetBundler, transpiler, cssMode, cssProcessor, testFramework, e2eFramework].filter(p => p));
110+
})
111+
});
112+
});
113+
});
114+
});
115+
116+
skeletons.forEach((features, i) => {
120117
const appName = features.join('-');
121118
const appFolder = path.join(folder, appName);
122119
const title = `App: ${i + 1}/${skeletons.length} ${appName}`;
@@ -132,11 +129,11 @@ skeletons.forEach((_f, i) => {
132129
await run(makeCmd);
133130
process.chdir(appFolder);
134131

135-
console.log('-- yarn install');
136-
await run('yarn install');
132+
console.log('-- pnpm install');
133+
await run('pnpm install');
137134

138-
// console.log('-- npm test');
139-
// await run('npm test');
135+
console.log('-- npm test');
136+
await run('npm test');
140137

141138
console.log('-- npm run build');
142139
await run('npm run build', null,

0 commit comments

Comments
 (0)