19 lines
498 B
JavaScript
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();
|
|
});
|
|
});
|