@chromatic-com/vitest 0.1.1 → 0.1.2
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) {
|
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
|
});
|