@chromatic-com/vitest 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/plugin.js
CHANGED
|
@@ -4115,6 +4115,8 @@ var NetworkIdleTracker = class _NetworkIdleTracker {
|
|
|
4115
4115
|
this.cdp.off("Network.loadingFinished", this.onComplete);
|
|
4116
4116
|
this.cdp.off("Network.loadingFailed", this.onComplete);
|
|
4117
4117
|
this.clearTimer();
|
|
4118
|
+
this.pending.clear();
|
|
4119
|
+
this.idleResolvers.splice(0).forEach((fn) => fn());
|
|
4118
4120
|
await this.cdp.send("Network.disable");
|
|
4119
4121
|
}
|
|
4120
4122
|
waitForIdle(rejectTimeout) {
|
|
@@ -4217,10 +4219,18 @@ var ChromaticReporter = class _ChromaticReporter {
|
|
|
4217
4219
|
if (this.options.builtInReporter !== "default" && this.options.builtInReporter !== "tree") {
|
|
4218
4220
|
return;
|
|
4219
4221
|
}
|
|
4222
|
+
let noSlowTests = true;
|
|
4223
|
+
for (const testCase of testModule.children.allTests()) {
|
|
4224
|
+
if (testCase.diagnostic()?.slow) {
|
|
4225
|
+
noSlowTests = false;
|
|
4226
|
+
break;
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
const indentProjectName = noSlowTests && this.options.builtInReporter === "default";
|
|
4220
4230
|
this.logSnapshots({
|
|
4221
4231
|
count: this.snapshotCountPerEntity.get(testModule.id) ?? 0,
|
|
4222
|
-
indentation:
|
|
4223
|
-
projectName:
|
|
4232
|
+
indentation: indentProjectName ? 3 : 2,
|
|
4233
|
+
projectName: indentProjectName && testModule.project.name
|
|
4224
4234
|
});
|
|
4225
4235
|
}
|
|
4226
4236
|
onTestRunEnd() {
|
package/dist/setupFile.js
CHANGED
|
@@ -144,6 +144,7 @@ beforeEach(async ({ task }) => {
|
|
|
144
144
|
task.meta.__chromatic_isTakeSnapshotCalled = false;
|
|
145
145
|
task.meta.__chromatic_options ||= {};
|
|
146
146
|
task.meta.__chromatic_options.disableAutoSnapshot ??= options.disableAutoSnapshot;
|
|
147
|
+
task.meta.__chromatic_options.resourceArchiveTimeout ??= options.resourceArchiveTimeout;
|
|
147
148
|
await commands3.__chromatic_interceptFetch();
|
|
148
149
|
return /* @__PURE__ */ __name(async function beforeEachCleanup() {
|
|
149
150
|
const { __chromatic_isTakeSnapshotCalled: isTakeSnapshotCalled, __chromatic_pendingTakeSnapshots: pendingTakeSnapshots, __chromatic_isRegistered: isRegistered } = task.meta;
|
|
@@ -169,24 +170,22 @@ beforeEach(async ({ task }) => {
|
|
|
169
170
|
__name(cleanup, "cleanup");
|
|
170
171
|
});
|
|
171
172
|
afterEach(async ({ task }) => {
|
|
172
|
-
const { __chromatic_options: options, __chromatic_pendingTakeSnapshots: pendingTakeSnapshots, __chromatic_isRegistered: isRegistered } = task.meta;
|
|
173
|
+
const { __chromatic_options: options, __chromatic_pendingTakeSnapshots: pendingTakeSnapshots, __chromatic_isRegistered: isRegistered, __chromatic_options: testOptions } = task.meta;
|
|
173
174
|
if (!isRegistered) {
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
177
|
if (pendingTakeSnapshots?.length) {
|
|
177
178
|
throw new PendingSnapshotsError(pendingTakeSnapshots);
|
|
178
179
|
}
|
|
179
|
-
if (
|
|
180
|
-
|
|
180
|
+
if (testOptions.resourceArchiveTimeout !== 0) {
|
|
181
|
+
await document.fonts.ready;
|
|
182
|
+
await waitForIdleNetwork(testOptions.resourceArchiveTimeout);
|
|
181
183
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
if (!options.disableAutoSnapshot) {
|
|
185
|
+
await takeSnapshot(void 0, {
|
|
186
|
+
ignoreUnawaited: true
|
|
187
|
+
});
|
|
186
188
|
}
|
|
187
|
-
await takeSnapshot(void 0, {
|
|
188
|
-
ignoreUnawaited: true
|
|
189
|
-
});
|
|
190
189
|
});
|
|
191
190
|
var PendingSnapshotsError = class PendingSnapshotsError2 extends AggregateError {
|
|
192
191
|
static {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @type {
|
|
1
|
+
/** @type {import('@storybook/server-webpack5').StorybookConfig} */
|
|
2
2
|
declare const _default: {
|
|
3
3
|
stories: string[];
|
|
4
4
|
managerEntries: string[];
|
|
@@ -12,6 +12,9 @@ declare const _default: {
|
|
|
12
12
|
renderer: string;
|
|
13
13
|
};
|
|
14
14
|
staticDirs: string[];
|
|
15
|
+
features: {
|
|
16
|
+
sidebarOnboardingChecklist: boolean;
|
|
17
|
+
};
|
|
15
18
|
};
|
|
16
19
|
|
|
17
20
|
export { _default as default };
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
import { addons } from "storybook/manager-api";
|
|
3
3
|
addons.setConfig({
|
|
4
4
|
sidebar: {
|
|
5
|
-
//
|
|
5
|
+
// Ensures we use folders at the root-level instead of categories
|
|
6
6
|
showRoots: false
|
|
7
|
+
},
|
|
8
|
+
layoutCustomisations: {
|
|
9
|
+
// Hide toolbar options that don't make sense in e2e setup
|
|
10
|
+
showToolbar: () => false,
|
|
11
|
+
// Hide bottom panel that's empty in e2e setup
|
|
12
|
+
showPanel: () => false
|
|
7
13
|
}
|
|
8
14
|
});
|