summaryrefslogtreecommitdiff
path: root/packages/webapi/test/urlpattern.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/webapi/test/urlpattern.js')
-rw-r--r--packages/webapi/test/urlpattern.js36
1 files changed, 12 insertions, 24 deletions
diff --git a/packages/webapi/test/urlpattern.js b/packages/webapi/test/urlpattern.js
index aac7f9d4e..b9ef6b31f 100644
--- a/packages/webapi/test/urlpattern.js
+++ b/packages/webapi/test/urlpattern.js
@@ -1,31 +1,19 @@
-import { assert, test } from '../run/test.setup.js'
+import { expect } from 'chai'
import { polyfill } from '../mod.js'
-test(() => {
- return [
- {
- name: 'Includes URLPattern',
- test() {
- const target = {}
+describe('URLPattern', () => {
+ const target = {}
- polyfill(target)
+ before(() => polyfill(target))
- assert.equal(Reflect.has(target, 'URLPattern'), true)
- assert.equal(typeof target.URLPattern, 'function')
- },
- },
- {
- name: 'Supports URLPattern usage',
- test() {
- const target = {}
+ it('Includes URLPattern', () => {
+ expect(target).to.have.property('URLPattern').that.is.a('function')
+ })
- polyfill(target)
+ it('Supports URLPattern usage', () => {
+ const pattern = new target.URLPattern({ pathname: '/hello/:name' })
+ const match = pattern.exec('https://example.com/hello/Deno')
- const pattern = new target.URLPattern({ pathname: '/hello/:name' })
- const match = pattern.exec('https://example.com/hello/Deno')
-
- assert.deepEqual(match.pathname.groups, { name: 'Deno' })
- },
- },
- ]
+ expect(match.pathname.groups).to.deep.equal({ name: 'Deno' })
+ })
})