Sha256: 26068e811f11073ce70c0d0691642991eb882f7a6819cf14e1e3d3706f835080
Contents?: true
Size: 1.04 KB
Versions: 3
Compression:
Stored size: 1.04 KB
Contents
import { get, Mixin, mixin } from '../..'; import { moduleFor, AbstractTestCase } from 'internal-test-helpers'; function K() {} moduleFor( 'Mixin.apply', class extends AbstractTestCase { ['@test using apply() should apply properties'](assert) { let MixinA = Mixin.create({ foo: 'FOO', baz: K }); let obj = {}; mixin(obj, MixinA); assert.equal(get(obj, 'foo'), 'FOO', 'should apply foo'); assert.equal(get(obj, 'baz'), K, 'should apply foo'); } ['@test applying anonymous properties'](assert) { let obj = {}; mixin(obj, { foo: 'FOO', baz: K, }); assert.equal(get(obj, 'foo'), 'FOO', 'should apply foo'); assert.equal(get(obj, 'baz'), K, 'should apply foo'); } ['@test applying null values']() { expectAssertion(() => mixin({}, null)); } ['@test applying a property with an undefined value'](assert) { let obj = { tagName: '' }; mixin(obj, { tagName: undefined }); assert.strictEqual(get(obj, 'tagName'), ''); } } );
Version data entries
3 entries across 3 versions & 1 rubygems