import { define } from '../../../src/index';

describe('lifecycle/defined', () => {
  it('should not already have the defined attribute on undefined elements', () => {
    expect(document.createElement('some-undefined-element').hasAttribute('defined')).to.equal(false);
  });

  it('should add the [defined] attribute when the element is upgraded', (done) => {
    const Elem = define('x-test', {});
    const elem = new Elem();

    document.body.appendChild(elem);

    setTimeout(() => {
      expect(elem.hasAttribute('defined')).to.equal(true);
      document.body.removeChild(elem);
      done();
    }, 1);
  });
});

@@ -37,16 +37,72 @@
 /index';
+%0Aimport afterMutations from '../../lib/after-mutations';
 %0A%0Adescri
@@ -475,24 +475,140 @@
 ew Elem();%0A%0A
+    // Sanity check for non-native (native would throw).%0A    expect(elem.hasAttribute('defined')).to.equal(false);%0A%0A
     document
@@ -636,23 +636,26 @@
 m);%0A
-%0A
     
-setTimeout
+afterMutations
 (() 

Use afterMutations. Add sanity check.