Skip to content

Commit 7818f18

Browse files
jonathanlabjoshsny
andauthored
fix: don't import e2e tests (#107)
* fix: don't import e2e tests in prod * bump version --------- Co-authored-by: Joshua Snyder <joshua@posthog.com>
1 parent 736815a commit 7818f18

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@posthog/wizard",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"homepage": "https://github.com/posthog/wizard",
55
"repository": "https://github.com/posthog/wizard",
66
"description": "The PostHog wizard helps you to configure your project",

src/utils/query.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import type { AIModel, CloudRegion } from './types';
55
import { getCloudUrlFromRegion } from './urls';
66
import { analytics } from './analytics';
77
import { AxiosError } from 'axios';
8-
import { fixtureTracker } from '../../e2e-tests/mocks/fixture-tracker';
9-
import { shouldRecord } from '../../e2e-tests/mocks/handlers';
108

119
export interface QueryOptions<S> {
1210
message: string;
@@ -36,7 +34,7 @@ export const query = async <S>({
3634
{
3735
headers: {
3836
'X-PostHog-Wizard-Hash': wizardHash,
39-
...(shouldRecord
37+
...(process.env.RECORD_FIXTURES === 'true'
4038
? { 'X-PostHog-Wizard-Fixture-Generation': true }
4139
: {}),
4240
},
@@ -65,6 +63,10 @@ export const query = async <S>({
6563
}
6664

6765
if (process.env.NODE_ENV === 'test') {
66+
const { fixtureTracker } = await import(
67+
'../../e2e-tests/mocks/fixture-tracker.js'
68+
);
69+
6870
const requestBody = JSON.stringify({
6971
message,
7072
model,

0 commit comments

Comments
 (0)