@yabbadabbadev/pepito 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/yabbadabbadev/pepito/compare/v0.3.0...v0.3.1) (2026-11-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * support msw 3 alongside msw 2 ([#57](https://github.com/yabbadabbadev/pepito/issues/57)) ([e2953b2](https://github.com/yabbadabbadev/pepito/commit/e2953b257b1345b458afe821cd302697e058529a))
9
+
10
+ ## [0.3.0](https://github.com/yabbadabbadev/pepito/compare/v0.2.0...v0.3.0) (2026-09-05)
11
+
12
+
13
+ ### Features
14
+
15
+ * broaden vitest peerDep to 4||5 and migrate to vitest 5 ([#11](https://github.com/yabbadabbadev/pepito/issues/11)) ([8bd6cde](https://github.com/yabbadabbadev/pepito/commit/8bd6cdee27e3d9d6d49b2243ff3f389fecbb3a8a))
16
+
3
17
  ## [0.2.0](https://github.com/yabbadabbadev/pepito/compare/v0.1.1...v0.2.0) (2026-09-02)
4
18
 
5
19
 
package/README.md CHANGED
@@ -115,9 +115,12 @@ console:
115
115
  import { setupNetwork } from '@yabbadabbadev/pepito'
116
116
  import { handlers } from './handlers'
117
117
 
118
- setupNetwork(handlers, { onUnhandledRequest: 'error' })
118
+ setupNetwork(handlers, { onUnhandledFrame: 'error' })
119
119
  ```
120
120
 
121
+ `onUnhandledFrame` is the msw 3 name; on msw 2 the same option is
122
+ `onUnhandledRequest`.
123
+
121
124
  Importing anything from `pepito` — even just `setupNetwork` — already
122
125
  brings the network matchers along as `expect` types: there's no separate
123
126
  type registration. If your test `tsconfig` doesn't include the setup
@@ -1,4 +1,4 @@
1
- import type { MatcherState } from '@vitest/expect';
1
+ import type { MatcherState } from 'vitest';
2
2
  import type { ExpectedResponse } from './matcher-types';
3
3
  import type { RequestSpec } from './request-descriptors';
4
4
  import type { ResolvedRequest } from './traffic-registry';
@@ -10,7 +10,7 @@ export interface ExpectedResponse {
10
10
  body?: unknown;
11
11
  exact?: boolean;
12
12
  }
13
- interface NetworkMatchers<ReturnType = unknown> {
13
+ export interface NetworkMatchers<ReturnType = unknown> {
14
14
  /**
15
15
  * Checks that the application made a request matching `spec`, by exact
16
16
  * `method` and `path` and `searchParams`/`body` by subset. Retries until
@@ -92,8 +92,8 @@ interface NetworkMatchers<ReturnType = unknown> {
92
92
  */
93
93
  toHaveNoUnhandledRequests(): Promise<ReturnType>;
94
94
  }
95
- declare module '@vitest/expect' {
96
- interface Assertion<T = any> extends NetworkMatchers<T> {
95
+ declare module 'vitest' {
96
+ interface Assertion<R extends void | Promise<void> = void, T = unknown> extends NetworkMatchers<T> {
97
97
  }
98
98
  interface AsymmetricMatchersContaining extends NetworkMatchers {
99
99
  }
@@ -107,7 +107,6 @@ declare module '@vitest/expect' {
107
107
  * await expect.network().toHaveNoUnhandledRequests()
108
108
  * ```
109
109
  */
110
- network(): Assertion<unknown>;
110
+ network(): Assertion<void>;
111
111
  }
112
112
  }
113
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yabbadabbadev/pepito",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Network test utilities for Vitest browser mode: application mounting and matchers over the traffic observed by MSW",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,46 +56,36 @@
56
56
  "build": "tsc -p tsconfig.build.json",
57
57
  "pack:local": "npm run build && npm pack --pack-destination dist-pack",
58
58
  "setup": "playwright install chromium",
59
- "lint": "eslint --cache . --report-unused-disable-directives --max-warnings 0",
60
- "lint-fix": "eslint --cache . --fix",
59
+ "lint": "oxlint --report-unused-disable-directives .",
60
+ "lint-fix": "oxlint --fix .",
61
61
  "format": "prettier --write .",
62
62
  "format:check": "prettier --check ."
63
63
  },
64
64
  "peerDependencies": {
65
- "msw": "^2.15.0",
66
- "vitest": "^4.0.0"
65
+ "msw": "^2.15.0 || ^3.0.0",
66
+ "vitest": "^4.0.0 || ^5.0.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@eslint/js": "^9.39.5",
70
69
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
71
70
  "@types/react": "^19.2.18",
72
71
  "@types/react-dom": "^19.2.4",
73
- "@typescript-eslint/eslint-plugin": "^8.67.0",
74
- "@typescript-eslint/parser": "^8.67.0",
75
72
  "@vitejs/plugin-react": "^6.0.5",
76
- "@vitest/browser": "^4.1.10",
77
- "@vitest/browser-playwright": "^4.1.10",
78
- "@vitest/coverage-v8": "^4.1.10",
79
- "eslint": "^9.39.5",
80
- "eslint-config-prettier": "^10.1.8",
81
- "eslint-plugin-prettier": "^5.5.6",
82
- "eslint-plugin-react": "^7.37.5",
83
- "eslint-plugin-react-hooks": "^5.2.0",
84
- "eslint-plugin-react-refresh": "^0.4.26",
85
- "eslint-plugin-vitest-globals": "^1.6.1",
86
- "globals": "^17.9.0",
87
- "msw": "^2.15.0",
73
+ "@vitest/browser": "^5.0.0",
74
+ "@vitest/browser-playwright": "^5.0.0",
75
+ "@vitest/coverage-v8": "^5.0.0",
76
+ "msw": "^3.0.4",
77
+ "oxlint": "^1.81.0",
88
78
  "playwright": "^1.62.1",
89
79
  "prettier": "^3.9.6",
90
80
  "react": "^19.2.8",
91
81
  "react-dom": "^19.2.8",
92
82
  "react-router": "^8.3.0",
93
83
  "svelte": "^5.57.0",
94
- "typescript": "^6.0.3",
95
- "vitest": "^4.1.10",
96
- "vitest-browser-react": "^2.2.0",
97
- "vitest-browser-svelte": "^3.0.0",
98
- "vitest-browser-vue": "^2.1.0",
84
+ "typescript": "^7.0.2",
85
+ "vitest": "^5.0.0",
86
+ "vitest-browser-react": "^2.3.0",
87
+ "vitest-browser-svelte": "^3.1.0",
88
+ "vitest-browser-vue": "^3.1.0",
99
89
  "vue": "^3.5.42"
100
90
  },
101
91
  "msw": {