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/internals.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/internals.js')
-rw-r--r-- | packages/webapi/test/internals.js | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/packages/webapi/test/internals.js b/packages/webapi/test/internals.js index 6972f65a2..054b7e488 100644 --- a/packages/webapi/test/internals.js +++ b/packages/webapi/test/internals.js @@ -1,34 +1,26 @@ -import { assert, test } from '../run/test.setup.js' +import { expect } from 'chai' import { polyfill } from '../mod.js' -test(() => { - return [ - { - name: 'Includes polyfill.internals functionality', - test() { - const target = {} +it('Includes polyfill.internals functionality', () => { + const target = {} - polyfill(target, { exclude: 'window document' }) + polyfill(target, { exclude: 'window document' }) - const pseudo = { ...target } + const pseudo = { ...target } - assert.equal(Reflect.has(pseudo, 'document'), false) + expect(pseudo).to.not.have.property('document') - const CustomElement = class extends pseudo.HTMLElement {} + const CustomElement = class extends pseudo.HTMLElement {} - pseudo.customElements.define('custom-element', CustomElement) + pseudo.customElements.define('custom-element', CustomElement) - polyfill.internals(pseudo, 'Document') + polyfill.internals(pseudo, 'Document') - assert.equal(Reflect.has(pseudo, 'document'), true) + expect(pseudo).to.have.property('document') - assert.equal( - CustomElement.prototype.isPrototypeOf( - pseudo.document.createElement('custom-element') - ), - true - ) - }, - }, - ] + expect( + CustomElement.prototype.isPrototypeOf( + pseudo.document.createElement('custom-element') + ) + ).to.equal(true) }) |