Skip to content

Commit

Permalink
chore(deps): update all non-major dependencies (#6046)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
  • Loading branch information
renovate[bot] and sheremet-va committed Jul 15, 2024
1 parent 717bb2e commit f55dc00
Show file tree
Hide file tree
Showing 43 changed files with 1,354 additions and 1,283 deletions.
8 changes: 4 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"devDependencies": {
"@iconify-json/carbon": "^1.1.36",
"@iconify-json/logos": "^1.1.43",
"@shikijs/vitepress-twoslash": "^1.10.0",
"@unocss/reset": "^0.61.0",
"@shikijs/vitepress-twoslash": "^1.10.3",
"@unocss/reset": "^0.61.3",
"@vite-pwa/assets-generator": "^0.2.4",
"@vite-pwa/vitepress": "^0.5.0",
"@vitejs/plugin-vue": "latest",
"fast-glob": "^3.3.2",
"https-localhost": "^4.7.1",
"unocss": "^0.61.0",
"unocss": "^0.61.3",
"unplugin-vue-components": "^0.27.2",
"vite": "^5.2.8",
"vite-plugin-pwa": "^0.20.0",
"vitepress": "^1.2.3",
"vitepress": "^1.3.1",
"workbox-window": "^7.1.0"
}
}
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default antfu(

// TODO: migrate and turn it back on
'ts/ban-types': 'off',
'ts/no-unsafe-function-type': 'off',

'no-restricted-imports': [
'error',
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,34 @@
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.2",
"@antfu/ni": "^0.21.12",
"@playwright/test": "^1.45.0",
"@antfu/eslint-config": "^2.22.2",
"@antfu/ni": "^0.22.0",
"@playwright/test": "^1.45.1",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/node": "^20.14.9",
"@types/ws": "^8.5.10",
"@types/node": "^20.14.10",
"@types/ws": "^8.5.11",
"@vitest/browser": "workspace:*",
"@vitest/coverage-istanbul": "workspace:*",
"@vitest/coverage-v8": "workspace:*",
"@vitest/ui": "workspace:*",
"bumpp": "^9.4.1",
"esbuild": "^0.22.0",
"eslint": "^9.6.0",
"esbuild": "^0.23.0",
"eslint": "^9.7.0",
"fast-glob": "^3.3.2",
"magic-string": "^0.30.10",
"pathe": "^1.1.2",
"rimraf": "^6.0.1",
"rollup": "^4.18.0",
"rollup": "^4.18.1",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-license": "^3.5.1",
"tsx": "^4.16.0",
"typescript": "^5.5.2",
"rollup-plugin-license": "^3.5.2",
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"vite": "^5.3.3",
"vitest": "workspace:*",
"zx": "^8.1.3"
"zx": "^8.1.4"
},
"pnpm": {
"overrides": {
Expand Down
12 changes: 6 additions & 6 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@
}
},
"dependencies": {
"@testing-library/dom": "^10.2.0",
"@testing-library/dom": "^10.3.1",
"@testing-library/user-event": "^14.5.2",
"@vitest/utils": "workspace:*",
"magic-string": "^0.30.10",
"msw": "^2.3.1",
"sirv": "^2.0.4",
"ws": "^8.17.1"
"ws": "^8.18.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.4.6",
"@types/ws": "^8.5.10",
"@types/ws": "^8.5.11",
"@vitest/runner": "workspace:*",
"@vitest/ui": "workspace:*",
"@vitest/ws-client": "workspace:*",
Expand All @@ -95,10 +95,10 @@
"flatted": "^3.3.1",
"pathe": "^1.1.2",
"periscopic": "^4.0.2",
"playwright": "^1.45.0",
"playwright-core": "^1.45.0",
"playwright": "^1.45.1",
"playwright-core": "^1.45.1",
"safaridriver": "^0.1.2",
"vitest": "workspace:*",
"webdriverio": "^8.39.0"
"webdriverio": "^8.39.1"
}
}
2 changes: 1 addition & 1 deletion packages/browser/src/client/tester/mocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class VitestBrowserClientMocker {
try {
Object.defineProperty(newContainer, property, descriptor)
}
catch (error) {
catch {
// Ignore errors, just move on to the next prop.
}
continue
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/client/tester/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function createBrowserRunner(
try {
await updateFilesLocations(files, this.sourceMapCache)
}
catch (_) {}
catch {}
}
return rpc().onCollected(files)
}
Expand Down
106 changes: 55 additions & 51 deletions packages/browser/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,65 +88,69 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => {
)
}

coverageFolder && server.middlewares.use(
coveragePath!,
sirv(coverageFolder[0], {
single: true,
dev: true,
setHeaders: (res) => {
res.setHeader(
'Cache-Control',
'public,max-age=0,must-revalidate',
)
},
}),
)
if (coverageFolder) {
server.middlewares.use(
coveragePath!,
sirv(coverageFolder[0], {
single: true,
dev: true,
setHeaders: (res) => {
res.setHeader(
'Cache-Control',
'public,max-age=0,must-revalidate',
)
},
}),
)
}

const screenshotFailures = project.config.browser.ui && project.config.browser.screenshotFailures

if (screenshotFailures) {
// eslint-disable-next-line prefer-arrow-callback
screenshotFailures && server.middlewares.use(`${base}__screenshot-error`, function vitestBrowserScreenshotError(req, res) {
if (!req.url || !browserServer.provider) {
res.statusCode = 404
res.end()
return
}
server.middlewares.use(`${base}__screenshot-error`, function vitestBrowserScreenshotError(req, res) {
if (!req.url || !browserServer.provider) {
res.statusCode = 404
res.end()
return
}

const url = new URL(req.url, 'http://localhost')
const file = url.searchParams.get('file')
if (!file) {
res.statusCode = 404
res.end()
return
}
const url = new URL(req.url, 'http://localhost')
const file = url.searchParams.get('file')
if (!file) {
res.statusCode = 404
res.end()
return
}

let stat: Stats | undefined
try {
stat = lstatSync(file)
}
catch (_) {
}
let stat: Stats | undefined
try {
stat = lstatSync(file)
}
catch {
}

if (!stat?.isFile()) {
res.statusCode = 404
res.end()
return
}
if (!stat?.isFile()) {
res.statusCode = 404
res.end()
return
}

const ext = extname(file)
const buffer = readFileSync(file)
res.setHeader(
'Cache-Control',
'public,max-age=0,must-revalidate',
)
res.setHeader('Content-Length', buffer.length)
res.setHeader('Content-Type', ext === 'jpeg' || ext === 'jpg'
? 'image/jpeg'
: ext === 'webp'
? 'image/webp'
: 'image/png')
res.end(buffer)
})
const ext = extname(file)
const buffer = readFileSync(file)
res.setHeader(
'Cache-Control',
'public,max-age=0,must-revalidate',
)
res.setHeader('Content-Length', buffer.length)
res.setHeader('Content-Type', ext === 'jpeg' || ext === 'jpg'
? 'image/jpeg'
: ext === 'webp'
? 'image/webp'
: 'image/png')
res.end(buffer)
})
}
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/expect/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export interface JestAssertion<T = any> extends jest.Matchers<void, T> {
toStrictEqual: <E>(expected: E) => void
toBe: <E>(expected: E) => void
toMatch: (expected: string | RegExp) => void
toMatchObject: <E extends {} | any[]>(expected: E) => void
toMatchObject: <E extends object | any[]>(expected: E) => void
toContain: <E>(item: E) => void
toContainEqual: <E>(item: E) => void
toBeTruthy: () => void
Expand Down Expand Up @@ -212,7 +212,7 @@ declare global {
// support augmenting jest.Matchers by other libraries
// eslint-disable-next-line ts/no-namespace
namespace jest {
// eslint-disable-next-line unused-imports/no-unused-vars
// eslint-disable-next-line unused-imports/no-unused-vars, ts/no-empty-object-type
interface Matchers<R, T = {}> {}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/runner/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function afterAll(fn: SuiteHooks['afterAll'][0], timeout?: number) {
withTimeout(fn, timeout ?? getDefaultHookTimeout(), true),
)
}
export function beforeEach<ExtraContext = {}>(
export function beforeEach<ExtraContext = object>(
fn: SuiteHooks<ExtraContext>['beforeEach'][0],
timeout?: number,
) {
Expand All @@ -35,7 +35,7 @@ export function beforeEach<ExtraContext = {}>(
withTimeout(withFixtures(fn), timeout ?? getDefaultHookTimeout(), true),
)
}
export function afterEach<ExtraContext = {}>(
export function afterEach<ExtraContext = object>(
fn: SuiteHooks<ExtraContext>['afterEach'][0],
timeout?: number,
) {
Expand Down
40 changes: 25 additions & 15 deletions packages/runner/src/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function clearCollectorContext(
collectorContext.currentSuite = defaultSuite
}

export function getCurrentSuite<ExtraContext = {}>() {
export function getCurrentSuite<ExtraContext = object>() {
return (collectorContext.currentSuite
|| defaultSuite) as SuiteCollector<ExtraContext>
}
Expand Down Expand Up @@ -429,19 +429,24 @@ function createSuite() {
cases.forEach((i, idx) => {
const items = Array.isArray(i) ? i : [i]
if (fnFirst) {
arrayOnlyCases
? suite(
if (arrayOnlyCases) {
suite(
formatTitle(_name, items, idx),
() => handler(...items),
options,
)
: suite(formatTitle(_name, items, idx), () => handler(i), options)
}
else {
suite(formatTitle(_name, items, idx), () => handler(i), options)
}
}
else {
arrayOnlyCases
? suite(formatTitle(_name, items, idx), options, () =>
handler(...items))
: suite(formatTitle(_name, items, idx), options, () => handler(i))
if (arrayOnlyCases) {
suite(formatTitle(_name, items, idx), options, () => handler(...items))
}
else {
suite(formatTitle(_name, items, idx), options, () => handler(i))
}
}
})

Expand Down Expand Up @@ -497,19 +502,24 @@ export function createTaskCollector(
const items = Array.isArray(i) ? i : [i]

if (fnFirst) {
arrayOnlyCases
? test(
if (arrayOnlyCases) {
test(
formatTitle(_name, items, idx),
() => handler(...items),
options,
)
: test(formatTitle(_name, items, idx), () => handler(i), options)
}
else {
test(formatTitle(_name, items, idx), () => handler(i), options)
}
}
else {
arrayOnlyCases
? test(formatTitle(_name, items, idx), options, () =>
handler(...items))
: test(formatTitle(_name, items, idx), options, () => handler(i))
if (arrayOnlyCases) {
test(formatTitle(_name, items, idx), options, () => handler(...items))
}
else {
test(formatTitle(_name, items, idx), options, () => handler(i))
}
}
})

Expand Down
Loading

0 comments on commit f55dc00

Please sign in to comment.