tiptap/tests/cypress/integration/core/isClass.spec.ts

20 lines
400 B
TypeScript
Raw Normal View History

2021-01-20 22:35:25 +08:00
/// <reference types="cypress" />
import { isClass } from '@tiptap/core/src/utilities/isClass'
2021-01-20 22:35:25 +08:00
describe('isClass', () => {
it('returns true for classes', () => {
const instance = new (class {
public foo = 'bar'
})()
expect(isClass(instance)).to.eq(true)
})
it('return false for objects', () => {
const instance = {}
expect(isClass(instance)).to.eq(false)
})
})