From 0799a4a86c8cd5e771106325e311db2758c26017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rge=20N=C3=A6ss?= Date: Fri, 6 Dec 2024 16:16:21 +0100 Subject: [PATCH] test(cli): make it easier to configure token for running cli tests locally --- .env.example | 3 +++ packages/@sanity/cli/vitest.config.mts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/.env.example b/.env.example index 8f03c8d450e..45ac2a721cb 100644 --- a/.env.example +++ b/.env.example @@ -14,3 +14,6 @@ SANITY_E2E_BASE_URL=http://localhost:3339 # Whether or not to run the end to end tests in headless mode. Defaults to true, but sometimes # you might want to see the browser in action, in which case you can set this to `false`. HEADLESS=true + +# Token for running CLI tests locally +SANITY_CI_CLI_AUTH_TOKEN_STAGING= diff --git a/packages/@sanity/cli/vitest.config.mts b/packages/@sanity/cli/vitest.config.mts index 8266470689a..b48d657579f 100644 --- a/packages/@sanity/cli/vitest.config.mts +++ b/packages/@sanity/cli/vitest.config.mts @@ -1,4 +1,10 @@ import {defineConfig} from '@repo/test-config/vitest' +// needed for globalSetup +import dotenv from 'dotenv' + +dotenv.config({ + path: [`${__dirname}/../../../.env.local`, `${__dirname}/../../../.env`], +}) export default defineConfig({ test: {