diff options
author | 2022-04-10 22:29:46 -0300 | |
---|---|---|
committer | 2022-04-10 18:29:46 -0700 | |
commit | 1907255ca239a94b76b1fe3a844a35f0436b8e3d (patch) | |
tree | f4c9935e0ea92f07478fece6a60b85795b24143a /packages/webapi/test/urlpattern.js | |
parent | 47f20a189f5479b5e84f99e6feda3be7080e455f (diff) | |
download | astro-1907255ca239a94b76b1fe3a844a35f0436b8e3d.tar.gz astro-1907255ca239a94b76b1fe3a844a35f0436b8e3d.tar.zst astro-1907255ca239a94b76b1fe3a844a35f0436b8e3d.zip |
chore: webapi test now use chai (#3048)
Diffstat (limited to 'packages/webapi/test/urlpattern.js')
-rw-r--r-- | packages/webapi/test/urlpattern.js | 36 |
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' }) + }) }) |