Skip to content

Commit 14b1db1

Browse files
committed
test: Ensure log tests have an empty stderr
1 parent 93b3084 commit 14b1db1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/logs.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ test('Should log which routes were prerendered & where they were discovered', as
2222

2323
// The prerender info is pushed as a single log line
2424
const stdout = output.stdout.find((line) => line.includes('Prerendered'));
25+
const stderr = output.stderr;
2526

2627
assert.match(stdout, 'Prerendered 3 pages:\n');
2728
assert.match(stdout, '/\n');
2829
assert.match(stdout, '/foo [from /]\n');
2930
assert.match(stdout, '/bar [from /foo]\n');
31+
assert.equal(stderr, []);
3032
});
3133

3234
test('Should strip sourcemap sizes from logs if user has not enabled sourcemaps', async () => {
@@ -35,7 +37,10 @@ test('Should strip sourcemap sizes from logs if user has not enabled sourcemaps'
3537
await output.done;
3638

3739
const stdout = output.stdout.find((line) => /dist\/assets\/index.*\.js/.test(line));
40+
const stderr = output.stderr;
41+
3842
assert.not.match(stdout, '│ map:');
43+
assert.equal(stderr, []);
3944
});
4045

4146
test('Should preserve sourcemap sizes from logs if user has enabled sourcemaps', async () => {
@@ -53,7 +58,10 @@ test('Should preserve sourcemap sizes from logs if user has enabled sourcemaps',
5358
await output.done;
5459

5560
const stdout = output.stdout.find((line) => /dist\/assets\/index.*\.js/.test(line));
61+
const stderr = output.stderr;
62+
5663
assert.match(stdout, '│ map:');
64+
assert.equal(stderr, []);
5765
});
5866

5967
test.run();

0 commit comments

Comments
 (0)