summaryrefslogtreecommitdiff
path: root/packages/webapi/test/structuredclone.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/webapi/test/structuredclone.js')
-rw-r--r--packages/webapi/test/structuredclone.js50
1 files changed, 19 insertions, 31 deletions
diff --git a/packages/webapi/test/structuredclone.js b/packages/webapi/test/structuredclone.js
index 5e79f3194..0503cf904 100644
--- a/packages/webapi/test/structuredclone.js
+++ b/packages/webapi/test/structuredclone.js
@@ -1,40 +1,28 @@
-import { assert, test } from '../run/test.setup.js'
+import { expect } from 'chai'
import { polyfill } from '../mod.js'
-test(() => {
- return [
- {
- name: 'Includes structuredClone',
- test() {
- const target = {}
+describe('structuredClone', () => {
+ const target = {}
- polyfill(target)
+ before(() => polyfill(target))
- assert.equal(Reflect.has(target, 'structuredClone'), true)
- assert.equal(typeof target.structuredClone, 'function')
- },
- },
- {
- name: 'Supports structuredClone usage',
- test() {
- const target = {}
-
- polyfill(target)
+ it('Includes structuredClone', () => {
+ expect(target).to.have.property('structuredClone').that.is.a('function')
+ })
- const obj = {
- foo: 'bar',
- baz: {
- qux: 'quux',
- },
- }
+ it('Supports structuredClone usage', () => {
+ const obj = {
+ foo: 'bar',
+ baz: {
+ qux: 'quux',
+ },
+ }
- const clone = target.structuredClone(obj)
+ const clone = target.structuredClone(obj)
- assert.notEqual(obj, clone)
- assert.notEqual(obj.baz, clone.baz)
+ expect(obj).to.not.equal(clone)
+ expect(obj.baz).to.not.equal(clone.baz)
- assert.equal(obj.baz.qux, clone.baz.qux)
- },
- },
- ]
+ expect(obj.baz.qux).to.equal(clone.baz.qux)
+ })
})