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