2016-08-04 17:49:32 +02:00
|
|
|
/* eslint-env qunit */
|
2015-09-22 17:19:04 +02:00
|
|
|
import extendFn from '../../src/js/extend.js';
|
2015-07-10 20:42:29 +02:00
|
|
|
|
2016-08-04 17:49:32 +02:00
|
|
|
QUnit.module('extend.js');
|
2015-07-10 20:42:29 +02:00
|
|
|
|
2016-08-04 17:49:32 +02:00
|
|
|
QUnit.test('should add implicit parent constructor call', function() {
|
|
|
|
let superCalled = false;
|
|
|
|
const Parent = function() {
|
2015-07-10 20:42:29 +02:00
|
|
|
superCalled = true;
|
|
|
|
};
|
2016-08-04 17:49:32 +02:00
|
|
|
const Child = extendFn(Parent, {
|
|
|
|
foo: 'bar'
|
2015-07-10 20:42:29 +02:00
|
|
|
});
|
2016-08-04 17:49:32 +02:00
|
|
|
const child = new Child();
|
|
|
|
|
|
|
|
QUnit.ok(superCalled, 'super constructor called');
|
|
|
|
QUnit.ok(child.foo, 'child properties set');
|
2015-07-10 20:42:29 +02:00
|
|
|
});
|