Skip to content

Commit 5297f32

Browse files
authored
test: fix tests failing in CI (#8083)
1 parent f858f3b commit 5297f32

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

test/config/fixtures/css/test/default-css.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ describe('don\'t process css by default', () => {
2222
const { default: styles } = await import('../App.module.css')
2323

2424
// HASH is static, based on the filepath to root
25-
expect(styles.module).toBe('_module_c70a46')
26-
expect(styles.someRandomValue).toBe('_someRandomValue_c70a46')
25+
expect(styles.module).toBe('_module_cdbed7')
26+
expect(styles.someRandomValue).toBe('_someRandomValue_cdbed7')
2727
const element = document.createElement('div')
28-
element.className = '_module_c70a46'
28+
element.className = '_module_cdbed7'
2929
const computed = window.getComputedStyle(element)
3030
expect(computed.display).toBe('block')
3131
expect(computed.width).toBe('')
3232
expect(element).toMatchInlineSnapshot(`
3333
<div
34-
class="_module_c70a46"
34+
class="_module_cdbed7"
3535
/>
3636
`)
3737
})

test/config/fixtures/css/test/process-css.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ describe('process only css, not module css', () => {
2121
test('module is not processed', async () => {
2222
const { default: styles } = await import('../App.module.css')
2323

24-
expect(styles.module).toBe('_module_c70a46')
25-
expect(styles.someRandomValue).toBe('_someRandomValue_c70a46')
24+
expect(styles.module).toBe('_module_cdbed7')
25+
expect(styles.someRandomValue).toBe('_someRandomValue_cdbed7')
2626
const element = document.createElement('div')
27-
element.className = '_module_c70a46'
27+
element.className = '_module_cdbed7'
2828
const computed = window.getComputedStyle(element)
2929
expect(computed.display).toBe('block')
3030
expect(computed.width).toBe('')
3131
expect(element).toMatchInlineSnapshot(`
3232
<div
33-
class="_module_c70a46"
33+
class="_module_cdbed7"
3434
/>
3535
`)
3636
})

test/config/fixtures/css/test/process-module.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ describe('processing module css', () => {
1616
test('module is processed', async () => {
1717
const { default: styles } = await import('../App.module.css')
1818

19-
expect(styles.module).toBe('_module_c70a46')
19+
expect(styles.module).toBe('_module_cdbed7')
2020
expect(styles.someRandomValue).toBeUndefined()
2121
const element = document.createElement('div')
22-
element.className = '_main_c70a46 _module_c70a46'
22+
element.className = '_main_cdbed7 _module_cdbed7'
2323
const computed = window.getComputedStyle(element)
2424
expect(computed.display, 'css is processed').toBe('flex')
2525
expect(computed.width).toBe('100px')
2626
expect(element).toMatchInlineSnapshot(`
2727
<div
28-
class="_main_c70a46 _module_c70a46"
28+
class="_main_cdbed7 _module_cdbed7"
2929
/>
3030
`)
3131
})

test/config/test/cache.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test('default', async () => {
1515
expect(stderr).toBe('')
1616

1717
const cachePath = ctx!.cache.results.getCachePath()
18-
const path = resolve(root, 'node_modules/.vite/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
18+
const path = resolve(root, 'node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
1919
expect(cachePath).toMatch(path)
2020
})
2121

@@ -34,7 +34,7 @@ test('use cache.dir', async () => {
3434
expect(stderr).toContain('"cache.dir" is deprecated')
3535

3636
const cachePath = ctx!.cache.results.getCachePath()
37-
const path = resolve(root, 'node_modules/.vitest-custom/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
37+
const path = resolve(root, 'node_modules/.vitest-custom/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
3838
expect(cachePath).toMatch(path)
3939
})
4040

@@ -53,7 +53,7 @@ test('use cacheDir', async () => {
5353
expect(stderr).toBe('')
5454

5555
const cachePath = ctx!.cache.results.getCachePath()
56-
const path = resolve(root, 'node_modules/.vite-custom/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
56+
const path = resolve(root, 'node_modules/.vite-custom/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
5757
expect(cachePath).toMatch(path)
5858
})
5959

@@ -102,7 +102,7 @@ describe('with optimizer enabled', () => {
102102
expect(stderr).toBe('')
103103

104104
const cachePath = ctx!.cache.results.getCachePath()
105-
const path = resolve(root, 'node_modules/.vite/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
105+
const path = resolve(root, 'node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
106106
expect(cachePath).toBe(path)
107107
})
108108

@@ -122,7 +122,7 @@ describe('with optimizer enabled', () => {
122122
expect(stderr).toContain('"cache.dir" is deprecated')
123123

124124
const cachePath = ctx!.cache.results.getCachePath()
125-
const path = resolve(root, 'node_modules/.vitest-custom/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
125+
const path = resolve(root, 'node_modules/.vitest-custom/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
126126
expect(cachePath).toBe(path)
127127
})
128128

@@ -142,7 +142,7 @@ describe('with optimizer enabled', () => {
142142
expect(stderr).toBe('')
143143

144144
const cachePath = ctx!.cache.results.getCachePath()
145-
const path = resolve(root, 'node_modules/.vite-custom/vitest/d41d8cd98f00b204e9800998ecf8427e/results.json')
145+
const path = resolve(root, 'node_modules/.vite-custom/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json')
146146
expect(cachePath).toBe(path)
147147
})
148148
})

test/optimize-deps/test/ssr.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import { expect, test } from 'vitest'
88
// TODO: flaky on Windows
99
// https://github.com/vitest-dev/vitest/pull/5215#discussion_r1492066033
1010
test.skipIf(process.platform === 'win32')('import.meta.url', () => {
11-
expect(importMetaUrl).toContain('/node_modules/.vite/vitest/d41d8cd98f00b204e9800998ecf8427e/deps_ssr/')
11+
expect(importMetaUrl).toContain('/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/deps_ssr/')
1212
})

test/optimize-deps/test/web.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import { importMetaUrl } from '@vitest/test-dep-url'
66
import { expect, test } from 'vitest'
77

88
test('import.meta.url', () => {
9-
expect(importMetaUrl).toContain('/node_modules/.vite/vitest/d41d8cd98f00b204e9800998ecf8427e/deps/')
9+
expect(importMetaUrl).toContain('/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/deps/')
1010
})

0 commit comments

Comments
 (0)