/
_config.js
29 lines (27 loc) · 1.04 KB
/
_config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const assert = require('assert');
const { assertIncludes } = require('../../../utils.js');
module.exports = {
description: 'show errors with non-zero exit code for unfulfilled async plugin actions on exit',
command: 'rollup -c --silent',
after(err) {
// exit code check has to be here as error(err) is only called upon failure
assert.strictEqual(err && err.code, 1);
},
error() {
// do not abort test upon error
return true;
},
stderr(stderr) {
console.error(stderr);
assertIncludes(
stderr,
'Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:'
);
// these unfulfilled async hook actions may occur in random order
assertIncludes(stderr, '(buggy-plugin) resolveId "./c.js" "main.js"');
assertIncludes(stderr, '(buggy-plugin) load "./b.js"');
assertIncludes(stderr, '(buggy-plugin) transform "./a.js"');
assertIncludes(stderr, '(buggy-plugin) moduleParsed "./d.js"');
assertIncludes(stderr, '(buggy-plugin) shouldTransformCachedModule "./e.js"');
}
};