avocado/packages/core/test/virtualize-static.js
2021-01-05 11:25:37 -06:00

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();
});
});