avocado/packages/core/test/virtualize-static.js

19 lines
550 B
JavaScript
Raw Normal View History

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