Skip to content

Commit

Permalink
update test side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Aug 20, 2024
1 parent 720401e commit b9a607e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 198 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
run({ browserLauncher: chromium })
```

# 1/2 write 10 files into "../../../../../"
# 1/2 write 7 files into "./.jsenv/[email protected]/"

see [./@jsenv/core/](./@jsenv/core/)
see [./.jsenv/[email protected]/](./.jsenv/[email protected]/)

# 2/2 resolve

Expand Down

This file was deleted.

This file was deleted.

46 changes: 28 additions & 18 deletions packages/related/test/src/execution/reporters/reporter_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,20 @@ const createApplyColorOnFileRelativeUrl = (rootDirectoryUrl) => {
// all the things before in grey
// all the things after in the color
const before = parts.slice(0, i).join("/");
const after = parts.slice(i).join("/");
let pathColored = ANSI.color(`${before}/`, ANSI.GREY);
pathColored += ANSI.color(`${after}/${filename}`, color);
const packageDirectory = parts[i];
const packageDirectoryStylized = ANSI.color(
ANSI.effect(packageDirectory, ANSI.UNDERLINE),
color,
);
let pathColored = ANSI.color(`${before}/`, color);
if (i === parts.length - 1) {
pathColored += packageDirectoryStylized;
pathColored += ANSI.color(`/${filename}`, color);
return pathColored;
}
const after = parts.slice(i + 1).join("/");
pathColored += packageDirectoryStylized;
pathColored += ANSI.color(`/${after}/${filename}`, color);
return pathColored;
}
i++;
Expand Down Expand Up @@ -491,9 +502,12 @@ const descriptionFormatters = {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let skipped = ANSI.color(
`${UNICODE.CIRCLE_DOTTED_RAW} ${number}/${total} skipped`,
`${UNICODE.CIRCLE_DOTTED_RAW} ${number}`,
COLOR_SKIPPED,
);
skipped += ANSI.color(`/${total}`, COLOR_SKIPPED);
skipped += " ";
skipped += ANSI.color("skipped", COLOR_SKIPPED);
skipped += " ";
skipped += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_SKIPPED);
if (skipReason) {
Expand All @@ -508,10 +522,8 @@ const descriptionFormatters = {
) => {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let aborted = ANSI.color(
`${UNICODE.FAILURE_RAW} ${number}/${total}`,
COLOR_ABORTED,
);
let aborted = ANSI.color(`${UNICODE.FAILURE_RAW} ${number}`, COLOR_ABORTED);
aborted += ANSI.color(`/${total}`, COLOR_ABORTED);
aborted += " ";
aborted += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_ABORTED);
return aborted;
Expand All @@ -523,9 +535,10 @@ const descriptionFormatters = {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let cancelled = ANSI.color(
`${UNICODE.FAILURE_RAW} ${number}/${total}`,
`${UNICODE.FAILURE_RAW} ${number}`,
COLOR_CANCELLED,
);
cancelled += ANSI.color(`/${total}`, COLOR_CANCELLED);
cancelled += " ";
cancelled += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_CANCELLED);
return cancelled;
Expand All @@ -537,9 +550,10 @@ const descriptionFormatters = {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let timedout = ANSI.color(
`${UNICODE.FAILURE_RAW} ${number}/${total}`,
`${UNICODE.FAILURE_RAW} ${number}`,
COLOR_TIMEOUT,
);
timedout += ANSI.color(`/${total}`, COLOR_TIMEOUT);
timedout += " ";
timedout += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_TIMEOUT);
timedout += " ";
Expand All @@ -555,10 +569,8 @@ const descriptionFormatters = {
) => {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let failed = ANSI.color(
`${UNICODE.FAILURE_RAW} ${number}/${total}`,
COLOR_FAILED,
);
let failed = ANSI.color(`${UNICODE.FAILURE_RAW} ${number}`, COLOR_FAILED);
failed += ANSI.color(`/${total}`, COLOR_FAILED);
failed += " ";
failed += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_FAILED);
return failed;
Expand All @@ -569,10 +581,8 @@ const descriptionFormatters = {
) => {
const total = countersInOrder.planified;
const number = fillLeft(index + 1, total, "0");
let completed = ANSI.color(
`${UNICODE.OK_RAW} ${number}/${total}`,
COLOR_COMPLETED,
);
let completed = ANSI.color(`${UNICODE.OK_RAW} ${number}`, COLOR_COMPLETED);
completed += ANSI.color(`/${total}`, COLOR_COMPLETED);
completed += " ";
completed += applyColorOnFileRelativeUrl(fileRelativeUrl, COLOR_COMPLETED);
return completed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ const test = async (params) => {
const expect = {
// execution must take around 2s (due to the timeout)
executionDuration: assert.between(2_000, 6_000),
// the overall run duration and runtime alive duration is between 2/20s
runDuration: assert.between(2_000, 20_000),
runtimeDuration: assert.between(2_000, 20_000),
// the overall run duration and runtime alive duration is between 2/30s
runDuration: assert.between(2_000, 30_000),
runtimeDuration: assert.between(2_000, 30_000),
// it does not take more than 2s to start the file
timeBetweenRuntimeStartAndExecutionStart: assert.between(0, 2_000),
};
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b9a607e

Please sign in to comment.