const test = require('ava');
const createClass = require('./index');

test('create base class', t => {
  const BaseClass = createClass({
    constructor() {
      this.a = 1;
    },
  });

  const baseClass = new BaseClass();

  t.is(baseClass.a, 1);
});

test('init without new', t => {
  const baseClass = createClass({
    constructor() {
      this.a = 1;
    },
  });

  const instance = baseClass();

  t.is(instance.a, 1);
});

test('extend class', t => {
  const BaseClass = createClass({
    constructor() {
      this.a = 1;
    },
  });

  const ChildClass = BaseClass.extend({
    b: 2,
  });

  const childClass = new ChildClass();

  t.is(childClass.a, 1);
  t.is(childClass.b, 2);
});


@@ -253,449 +253,4 @@
 );%0A%0A
-test('init without new', t =%3E %7B%0A  const baseClass = createClass(%7B%0A    constructor() %7B%0A      this.a = 1;%0A    %7D,%0A  %7D);%0A%0A  const instance = baseClass();%0A%0A  t.is(instance.a, 1);%0A%7D);%0A%0Atest('extend class', t =%3E %7B%0A  const BaseClass = createClass(%7B%0A    constructor() %7B%0A      this.a = 1;%0A    %7D,%0A  %7D);%0A%0A  const ChildClass = BaseClass.extend(%7B%0A    b: 2,%0A  %7D);%0A%0A  const childClass = new ChildClass();%0A%0A  t.is(childClass.a, 1);%0A  t.is(childClass.b, 2);%0A%7D);%0A%0A

decrease code coverage