avocado/packages/core/test/virtualize.js
2022-03-14 15:07:47 -05:00

19 lines
498 B
JavaScript

import {expect} from 'chai';
import virtualize from '../src/virtualize';
const NoMethod = virtualize(['method'], class {});
const Method = class extends virtualize(['method'])(class {}) {method() {}};
describe('virtualize', () => {
it("throws if virtual methods aren't implemented", () => {
expect(() => {
new NoMethod();
}).to.throw();
});
it("doesn't throw if virtual methods are implemented", () => {
expect(() => {
new Method();
}).to.not.throw();
});
});