Skip to content

Commit 68ce330

Browse files
committed
Merge branch 'master' of https://github.com/rollup/rollup into sync-7759f568
2 parents 39dc46a + 7759f56 commit 68ce330

File tree

138 files changed

+286
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+286
-154
lines changed

test/cli/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ async function runTest(config) {
5959
killSignal: 'SIGKILL'
6060
};
6161
const childProcess = config.spawnArgs
62-
? spawn('node', [rollupBinary, ...config.spawnArgs], spawnOptions)
62+
? spawn('node', [config.spawnScript || rollupBinary, ...config.spawnArgs], spawnOptions)
6363
: exec(config.command.replace(/(^| )rollup($| )/g, ` node ${rollupBinary} `), spawnOptions);
6464

6565
childProcess.stdout.on('data', data => {
66-
stdout += data;
66+
stdout += String(data);
6767
});
6868

6969
childProcess.stderr.on('data', async data => {
70-
stderr += data;
70+
stderr += String(data);
7171
if (config.abortOnStderr) {
7272
try {
73-
if (await config.abortOnStderr(data)) {
73+
if (await config.abortOnStderr(String(data))) {
7474
childProcess.kill('SIGTERM');
7575
}
7676
} catch (error) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = defineTest({
22
description: 'allows output options to be prefixed with "output."',
3-
command: 'rollup main.js --output.format es --output.footer "console.log(\'Rollup!\')"'
3+
spawnArgs: ['main.js', '--output.format', 'es', '--output.footer', "console.log('Rollup!')"]
44
});

test/cli/samples/amd/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = defineTest({
22
description: 'sets AMD module ID and define function',
3-
command: 'rollup -i main.js -f amd --amd.id foo --amd.define defn'
3+
spawnArgs: ['-i', 'main.js', '-f', 'amd', '--amd.id', 'foo', '--amd.define', 'defn']
44
});
Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
module.exports = defineTest({
22
description: 'adds banner/intro/outro/footer',
3-
command:
4-
'rollup -i main.js -f iife --indent --banner "// banner" --intro "// intro" --outro "// outro" --footer "// footer"'
3+
spawnArgs: [
4+
'-i',
5+
'main.js',
6+
'-f',
7+
'iife',
8+
'--indent',
9+
'--banner',
10+
'// banner',
11+
'--intro',
12+
'// intro',
13+
'--outro',
14+
'// outro',
15+
'--footer',
16+
'// footer'
17+
]
518
});

test/cli/samples/code-splitting-named-default-inputs/_config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ const assert = require('node:assert');
22

33
module.exports = defineTest({
44
description: 'allows defining names via CLI',
5-
command:
6-
'rollup entry1=main1.js "Entry 2"="main 2.js" "main3.js" --entryFileNames [name]-[hash].js -f es',
5+
spawnArgs: [
6+
'entry1=main1.js',
7+
'Entry 2=main 2.js',
8+
'main3.js',
9+
'--entryFileNames',
10+
'[name]-[hash].js',
11+
'-f',
12+
'es'
13+
],
714
result(code) {
815
assert.equal(
916
code,

test/cli/samples/code-splitting-named-inputs/_config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@ const assert = require('node:assert');
22

33
module.exports = defineTest({
44
description: 'allows defining names via CLI',
5-
command:
6-
'rollup --entryFileNames [name]-[hash].js --input entry1=main1.js -i "Entry 2"="main 2.js" -i "main3.js" -f es',
5+
spawnArgs: [
6+
'--entryFileNames',
7+
'[name]-[hash].js',
8+
'--input',
9+
'entry1=main1.js',
10+
'-i',
11+
'Entry 2=main 2.js',
12+
'-i',
13+
'main3.js',
14+
'-f',
15+
'es'
16+
],
717
result(code) {
818
assert.equal(
919
code,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = defineTest({
22
description: 'supports using an async function as config',
3-
command: 'rollup -c'
3+
spawnArgs: ['-c']
44
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = defineTest({
22
description: 'does not transpile cjs configs and provides correct __filename',
3-
command: 'rollup -c'
3+
spawnArgs: ['-c']
44
});

test/cli/samples/config-cwd-case-insensitive-es6/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function toggleCase(s) {
55
module.exports = defineTest({
66
onlyWindows: true,
77
description: "can load ES6 config with cwd that doesn't match realpath",
8-
command: 'rollup -c',
8+
spawnArgs: ['-c'],
99
cwd: __dirname.replace(/^[a-z]:\\/i, toggleCase),
1010
execute: true
1111
});

test/cli/samples/config-cwd-case-insensitive/_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function toggleCase(s) {
55
module.exports = defineTest({
66
onlyWindows: true,
77
description: "can load config with cwd that doesn't match realpath",
8-
command: 'rollup -c',
8+
spawnArgs: ['-c'],
99
cwd: __dirname.replace(/^[a-z]:\\/i, toggleCase),
1010
execute: true
1111
});

0 commit comments

Comments
 (0)