Skip to content

Commit 0ee09e7

Browse files
committed
output verification messages
1 parent 16b4c3c commit 0ee09e7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export function test(test: TestDescriptor) {
112112
const sanitizeResources = test.context.santize?.resources;
113113
const sanitizeOps = test.context.santize?.ops;
114114
const sanitizeExit = test.context.santize?.exit;
115+
const userSession = !runningInCI();
115116

116117
Deno.test({
117118
name: testName,
@@ -164,13 +165,16 @@ export function test(test: TestDescriptor) {
164165
if (testOutput) {
165166
for (const ver of test.verify) {
166167
lastVerify = ver;
168+
if (userSession) {
169+
const verifyMsg = " [verify] > " + ver.name;
170+
console.log(userSession ? colors.dim(verifyMsg) : verifyMsg);
171+
}
167172
await ver.verify(testOutput);
168173
}
169174
}
170175
} catch (ex) {
171-
const colorize = !runningInCI();
172176
const border = "-".repeat(80);
173-
const coloredName = colorize
177+
const coloredName = userSession
174178
? colors.brightGreen(colors.italic(testName))
175179
: testName;
176180

@@ -192,14 +196,14 @@ export function test(test: TestDescriptor) {
192196
const testCommand = `${
193197
offset > 0 ? " ".repeat(offset + 2) : ""
194198
}${command} ${relPath}`;
195-
const coloredTestCommand = colorize
199+
const coloredTestCommand = userSession
196200
? colors.brightGreen(testCommand)
197201
: testCommand;
198202

199203
const verifyFailed = `[verify] > ${
200204
lastVerify ? lastVerify.name : "unknown"
201205
}`;
202-
const coloredVerify = colorize
206+
const coloredVerify = userSession
203207
? colors.brightGreen(verifyFailed)
204208
: verifyFailed;
205209

0 commit comments

Comments
 (0)