avocado/packages/core/test/virtualize.js

19 lines
506 B
JavaScript
Raw Normal View History

2021-01-02 22:01:57 -06:00
import {assert, expect} from 'chai';
import virtualize from '../src/virtualize';
const NoMethod = virtualize(['method'], class {});
const Method = class extends virtualize(['method'])(class {}) {method() {}};
2021-01-05 11:25:37 -06:00
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();
2021-01-02 22:01:57 -06:00
});
});