2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-15 13:32:24 +03:00

feat: continued progress

This commit is contained in:
pimlie
2020-11-01 20:53:39 +01:00
parent bb04dc068d
commit 642a62c561
26 changed files with 2593 additions and 1674 deletions
+26
View File
@@ -0,0 +1,26 @@
import * as utils from '../../src/utils'
describe('utils.clone', () => {
test('string', () => {
const str = 'test'
expect(utils.clone(str)).toBe(str)
})
test('array', () => {
const arr = ['test']
const crr = utils.clone(arr)
expect(crr).not.toBe(arr)
expect(crr[0]).toBe(arr[0])
})
test('object', () => {
const obj = { context: {}, child: {}, a: 1 }
const cbj = utils.clone(obj)
expect(cbj).not.toBe(obj)
expect(cbj.context).toBe(obj.context)
expect(cbj.child).not.toBe(obj.child)
expect(cbj.a).toBe(obj.a)
})
})