Skip to content

Commit b6fbd3e

Browse files
test: downgrade vitest
1 parent 24b890e commit b6fbd3e

File tree

5 files changed

+44
-53
lines changed

5 files changed

+44
-53
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
os: [ubuntu-latest, macos-latest]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
1818
node: [16]
1919

2020
steps:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"lint-staged": "13.0.3",
5959
"nuxt": "npm:[email protected]",
6060
"release-it": "15.4.2",
61-
"vitest": "^0.23.4"
61+
"vitest": "^0.21.1"
6262
},
6363
"resolutions": {
6464
"nuxt-purgecss": "link:./"

test/module-prerender.test.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/purging.test.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { promises as fsp } from 'fs'
2+
import { resolve } from 'path'
3+
import { fileURLToPath } from 'url'
4+
import { it, expect } from 'vitest'
5+
import { setup, useTestContext } from '@nuxt/test-utils'
6+
7+
await setup({
8+
rootDir: fileURLToPath(new URL('../playground', import.meta.url)),
9+
build: true,
10+
nuxtConfig: {
11+
hooks: {
12+
'modules:before' (ctx) {
13+
ctx.nuxt.options.nitro.prerender = { routes: ['/'] }
14+
}
15+
}
16+
}
17+
})
18+
19+
it('should purge classes', async () => {
20+
const ctx = useTestContext()
21+
const html = await fsp.readFile(
22+
resolve(ctx.nuxt!.options.nitro.output?.dir || '', 'public/index.html'),
23+
'utf-8'
24+
)
25+
26+
const CONTENT_TO_EXPECT = ['.red', 'div{color:green}', '.safe', '{color:salmon}', 'nuxt-config-class', 'external']
27+
CONTENT_TO_EXPECT.forEach(c => expect(html).toContain(c))
28+
29+
const CONTENT_TO_PURGE = ['purged']
30+
CONTENT_TO_PURGE.forEach(c => expect(html).not.toContain(c))
31+
})

yarn.lock

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7370,17 +7370,12 @@ tiny-invariant@^1.1.0:
73707370
resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642"
73717371
integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==
73727372

7373-
tinybench@^2.1.5:
7374-
version "2.2.1"
7375-
resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.2.1.tgz#592e2da80e0de62cc5c9454335ac7f132b335b6c"
7376-
integrity sha512-VxB1P8DUhpCC1j2WtKgFYpv3SwU7vtnfmG29cK7hXcqyD7lLiq6SYCVpDceoAT99mvTN+V8Ay4OdtZQbB72+Sw==
7377-
7378-
tinypool@^0.3.0:
7379-
version "0.3.0"
7380-
resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.3.0.tgz#c405d8b743509fc28ea4ca358433190be654f819"
7381-
integrity sha512-NX5KeqHOBZU6Bc0xj9Vr5Szbb1j8tUHIeD18s41aDJaPeC5QTdEhK0SpdpUrZlj2nv5cctNcSjaKNanXlfcVEQ==
7373+
tinypool@^0.2.4:
7374+
version "0.2.4"
7375+
resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.2.4.tgz#4d2598c4689d1a2ce267ddf3360a9c6b3925a20c"
7376+
integrity sha512-Vs3rhkUH6Qq1t5bqtb816oT+HeJTXfwt2cbPH17sWHIYKTotQIFPk3tf2fgqRrVyMDVOc1EnPgzIxfIulXVzwQ==
73827377

7383-
tinyspy@^1.0.2:
7378+
tinyspy@^1.0.0:
73847379
version "1.0.2"
73857380
resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-1.0.2.tgz#6da0b3918bfd56170fb3cd3a2b5ef832ee1dff0d"
73867381
integrity sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==
@@ -7784,21 +7779,19 @@ vite-plugin-checker@^0.5.1:
77847779
optionalDependencies:
77857780
fsevents "~2.3.2"
77867781

7787-
vitest@^0.23.4:
7788-
version "0.23.4"
7789-
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.23.4.tgz#7ebea620f203f4df09a27ca17819dc9da61f88ef"
7790-
integrity sha512-iukBNWqQAv8EKDBUNntspLp9SfpaVFbmzmM0sNcnTxASQZMzRw3PsM6DMlsHiI+I6GeO5/sYDg3ecpC+SNFLrQ==
7782+
vitest@^0.21.1:
7783+
version "0.21.1"
7784+
resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.21.1.tgz#b4f5b901c9a23a3aaec76d3404f3072821d93d00"
7785+
integrity sha512-WBIxuFmIDPuK47GO6Lu9eNeRMqHj/FWL3dk73OHH3eyPPWPiu+UB3QHLkLK2PEggCqJW4FaWoWg8R68S7p9+9Q==
77917786
dependencies:
77927787
"@types/chai" "^4.3.3"
77937788
"@types/chai-subset" "^1.3.3"
77947789
"@types/node" "*"
77957790
chai "^4.3.6"
77967791
debug "^4.3.4"
77977792
local-pkg "^0.4.2"
7798-
strip-literal "^0.4.1"
7799-
tinybench "^2.1.5"
7800-
tinypool "^0.3.0"
7801-
tinyspy "^1.0.2"
7793+
tinypool "^0.2.4"
7794+
tinyspy "^1.0.0"
78027795
vite "^2.9.12 || ^3.0.0-0"
78037796

78047797
vm2@^3.9.8:

0 commit comments

Comments
 (0)