@specific.dev/spectest 0.121.0 → 0.123.0
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/README.md +29 -1
- package/dist/browser.js +7 -5
- package/dist/components/supabase-coverage.d.ts +7 -0
- package/dist/components/supabase-coverage.js +375 -0
- package/dist/components/supabase.js +30 -7
- package/dist/index.d.ts +22 -17
- package/dist/index.js +70 -247
- package/dist/locator-errors.js +2 -1
- package/dist/locator.d.ts +32 -39
- package/dist/locator.js +12 -14
- package/dist/playwright-assertions.d.ts +11 -0
- package/dist/playwright-assertions.js +32 -0
- package/dist/text-match.d.ts +1 -14
- package/dist/text-match.js +1 -73
- package/dist/url-match.d.ts +1 -0
- package/dist/url-match.js +5 -9
- package/package.json +3 -2
- package/src/browser.ts +7 -5
- package/src/components/internal-fetch.test.ts +68 -0
- package/src/components/supabase-coverage.test.ts +261 -0
- package/src/components/supabase-coverage.ts +373 -0
- package/src/components/supabase.ts +30 -7
- package/src/index.ts +105 -356
- package/src/locator-assertions.test.ts +59 -0
- package/src/locator-errors.test.ts +4 -4
- package/src/locator-errors.ts +2 -1
- package/src/locator.ts +40 -50
- package/src/playwright-assertions.test.ts +231 -0
- package/src/playwright-assertions.ts +49 -0
- package/src/text-match.test.ts +0 -57
- package/src/text-match.ts +2 -98
- package/src/url-match.ts +5 -9
package/src/url-match.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
// URL pattern matching — shared by `browser.waitForURL(...)` and
|
|
2
2
|
// `expect(browser).toHaveURL(...)`.
|
|
3
3
|
//
|
|
4
|
-
// Both
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// this rather than letting playwright apply its own glob dialect, and the
|
|
8
|
-
// matcher polls it directly. Deliberately dependency-free so `index.ts` (the
|
|
9
|
-
// module a project imports on the host, where playwright isn't installed) can
|
|
10
|
-
// use it without pulling in `browser.ts`.
|
|
4
|
+
// Both accept glob strings, RegExp, or predicates over a URL. waitForURL
|
|
5
|
+
// uses matchesUrl; the assertion adapter passes regexes/predicates directly
|
|
6
|
+
// to Playwright and compiles string globs with the same globToRegExp helper.
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
9
|
* How a URL is matched. A **glob string** (`*` stays inside one path segment,
|
|
@@ -41,10 +37,10 @@ export function describeUrlPattern(pattern: UrlPattern): string {
|
|
|
41
37
|
return JSON.stringify(pattern);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
|
-
//
|
|
40
|
+
// Reuse compiled globs across waits and assertions.
|
|
45
41
|
const GLOB_CACHE = new Map<string, RegExp>();
|
|
46
42
|
|
|
47
|
-
function globToRegExp(glob: string): RegExp {
|
|
43
|
+
export function globToRegExp(glob: string): RegExp {
|
|
48
44
|
const hit = GLOB_CACHE.get(glob);
|
|
49
45
|
if (hit) return hit;
|
|
50
46
|
let out = "";
|