Skip to content

Commit 91e5957

Browse files
committed
Remove isDev() environment unit test, changes value depending on whether run locally in husky pre-commit hook or on GH Actions workflow
1 parent ab9634a commit 91e5957

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/components/scripts/utils/__tests__/environmentClient.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Tests the environment detection functions in a Vitest/jsdom context
55
*/
66
import { describe, it, expect } from 'vitest'
7-
import { isUnitTest, isE2eTest, isTest, isDev, isProd } from '@lib/config/environmentServer'
7+
import { isUnitTest, isE2eTest, isTest, isProd } from '@lib/config/environmentServer'
88

99
describe('Environment detection utilities', () => {
1010
it('isUnitTest should return true when running in Vitest', () => {
@@ -19,9 +19,7 @@ describe('Environment detection utilities', () => {
1919
expect(isTest()).toBe(true)
2020
})
2121

22-
it('isDev() should return true when running in Vitest', () => {
23-
expect(isDev()).toBe(true)
24-
})
22+
// Can't test isDev() - result varies between local and GH Action runner
2523

2624
it('isProd() should return false when running in Vitest', () => {
2725
expect(isProd()).toBe(false)

src/lib/config/__tests__/environmentServer.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Tests the wrapper functions around js-cookie library
44
*/
55
import { describe, it, expect } from 'vitest'
6-
import { isDev, isE2eTest, isProd, isTest, isUnitTest } from '@lib/config'
6+
import { isE2eTest, isProd, isTest, isUnitTest } from '@lib/config'
77

88
describe('Build-time environment handling utilities', () => {
99
it('should always report running in Vitest in a unit test', () => {
@@ -18,9 +18,7 @@ describe('Build-time environment handling utilities', () => {
1818
expect(isTest()).toBeTruthy()
1919
})
2020

21-
it('isDev() should return true when running in Vitest', () => {
22-
expect(isDev()).toBeTruthy()
23-
})
21+
// Can't test isDev() - result varies between local and GH Action runner
2422

2523
it('isProd() should return false when running in Vitest', () => {
2624
expect(isProd()).toBeFalsy()

0 commit comments

Comments
 (0)