@@ -95,17 +95,20 @@ index 7630baa..78ced77 100644
95
95
notifyOfPeerFailure() {
96
96
send({type: 'peer-failed'});
97
97
diff --git a/node_modules/ava/lib/reporters/default.js b/node_modules/ava/lib/reporters/default.js
98
- index 804e285..330164c 100644
98
+ index 804e285..8daf5ee 100644
99
99
--- a/node_modules/ava/lib/reporters/default.js
100
100
+++ b/node_modules/ava/lib/reporters/default.js
101
- @@ -679,7 +679,9 @@ export default class Reporter {
101
+ @@ -678,8 +678,11 @@ export default class Reporter {
102
+ this.lineWriter.writeLine(colors.todo(`${this.stats.todoTests} ${plur('test', this.stats.todoTests)} todo`));
102
103
}
103
104
104
- if (this.stats.unhandledRejections > 0) {
105
+ - if (this.stats.unhandledRejections > 0) {
105
106
- this.lineWriter.writeLine(colors.error(`${this.stats.unhandledRejections} unhandled ${plur('rejection', this.stats.unhandledRejections)}`));
106
- + const allowed = Number(process.env.AGORIC_AVA_ALLOW_UNHANDLED_REJECTIONS)
107
- + const color = this.stats.unhandledRejections <= allowed ? 'skip' : 'error';
108
- + this.lineWriter.writeLine(colors[color](`${this.stats.unhandledRejections} unhandled ${plur('rejection', this.stats.unhandledRejections)} (AGORIC_AVA_ALLOW_UNHANDLED_REJECTIONS=${allowed})`));
107
+ + // AGORIC: TODO(#11028): unhandled exceptions patch should be accomplished in userspace.
108
+ + if (this.stats.unhandledRejections > 0 || process.env.AGORIC_AVA_EXPECT_UNHANDLED_REJECTIONS) {
109
+ + const expected = Number(process.env.AGORIC_AVA_EXPECT_UNHANDLED_REJECTIONS || 0)
110
+ + const color = this.stats.unhandledRejections === expected ? 'skip' : 'error';
111
+ + this.lineWriter.writeLine(colors[color](`${this.stats.unhandledRejections} unhandled ${plur('rejection', this.stats.unhandledRejections)} (AGORIC_AVA_EXPECT_UNHANDLED_REJECTIONS=${expected})`));
109
112
}
110
113
111
114
if (this.stats.uncaughtExceptions > 0) {
@@ -142,19 +145,32 @@ index b1989a4..fa1617f 100644
142
145
error: evt.err ? dumpError(evt.err) : null,
143
146
index: ++this.i,
144
147
diff --git a/node_modules/ava/lib/run-status.js b/node_modules/ava/lib/run-status.js
145
- index 8471345..3110074 100644
148
+ index 8471345..7433712 100644
146
149
--- a/node_modules/ava/lib/run-status.js
147
150
+++ b/node_modules/ava/lib/run-status.js
148
- @@ -230,6 +230,10 @@ export default class RunStatus extends Emittery {
151
+ @@ -228,7 +228,7 @@ export default class RunStatus extends Emittery {
152
+ || this.stats.sharedWorkerErrors > 0
153
+ || this.stats.timeouts > 0
149
154
|| this.stats.uncaughtExceptions > 0
150
- || this.stats.unhandledRejections > 0
155
+ - || this.stats.unhandledRejections > 0
156
+ + // AGORIC: `unhandledRejections` are processed below.
151
157
) {
152
- + const allowed = Number(process.env.AGORIC_AVA_ALLOW_UNHANDLED_REJECTIONS);
153
- + if (this.stats.unhandledRejections <= allowed) {
154
- + return 0;
155
- + }
156
158
return 1;
157
159
}
160
+ @@ -237,6 +237,14 @@ export default class RunStatus extends Emittery {
161
+ return 1;
162
+ }
163
+
164
+ + // AGORIC: TODO(#11028): unhandled exceptions patch should be accomplished in userspace.
165
+ + if (this.stats.unhandledRejections > 0 || process.env.AGORIC_AVA_EXPECT_UNHANDLED_REJECTIONS) {
166
+ + const expected = Number(process.env.AGORIC_AVA_EXPECT_UNHANDLED_REJECTIONS || 0);
167
+ + if (this.stats.unhandledRejections !== expected) {
168
+ + return 1;
169
+ + }
170
+ + }
171
+ +
172
+ return 0;
173
+ }
158
174
159
175
diff --git a/node_modules/ava/lib/worker/base.js b/node_modules/ava/lib/worker/base.js
160
176
index cdd3c4a..4302a4a 100644
0 commit comments