Skip to content

Commit e3bdbdf

Browse files
committed
parametrised tests
1 parent 91456e4 commit e3bdbdf

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

build-tools/tasks/integ.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ const { parseArgs } = require('node:util');
88

99
module.exports = task('test:integ', async () => {
1010
const options = {
11-
shard: {
12-
type: 'string',
13-
},
11+
shard: { type: 'string' },
12+
reactVersion: { type: 'string' },
1413
};
15-
const shard = parseArgs({ options, strict: false }).values.shard;
14+
const { shard, reactVersion = '16' } = parseArgs({ options, strict: false }).values;
1615
const devServer = execa('webpack', ['serve', '--config', 'pages/webpack.config.integ.cjs'], {
1716
env: {
1817
NODE_ENV: 'development',
18+
REACT_VERSION: reactVersion,
1919
},
2020
});
2121
await waitOn({ resources: ['http://localhost:8080'] });

build-tools/tasks/motion.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@ const execa = require('execa');
44
const glob = require('glob');
55
const waitOn = require('wait-on');
66
const { task } = require('../utils/gulp-utils.js');
7+
const { parseArgs } = require('node:util');
78

89
module.exports = task('test:motion', async () => {
10+
const options = {
11+
reactVersion: { type: 'string' },
12+
};
13+
const { reactVersion = '16' } = parseArgs({ options, strict: false }).values;
914
const devServer = execa('webpack', ['serve', '--config', 'pages/webpack.config.integ.cjs'], {
1015
env: {
1116
NODE_ENV: 'development',
17+
REACT_VERSION: reactVersion,
1218
},
1319
});
1420
await waitOn({ resources: ['http://localhost:8080'] });

0 commit comments

Comments
 (0)