Sha256: 7843bef63febbfbeb10a855471436b295d44f24a50bdc07411dc004a5a42ec9f

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

import { DebugStack } from '@ember/-internals/glimmer';
import { DEBUG } from '@glimmer/env';
import { moduleFor, AbstractTestCase } from 'internal-test-helpers';

moduleFor(
  'Glimmer DebugStack',
  class extends AbstractTestCase {
    ['@test pushing and popping'](assert) {
      if (DEBUG) {
        let stack = new DebugStack();

        assert.equal(stack.peek(), undefined);

        stack.push('template:application');

        assert.equal(stack.peek(), '"template:application"');

        stack.push('component:top-level-component');

        assert.equal(stack.peek(), '"component:top-level-component"');

        stack.pushEngine('engine:my-engine');
        stack.push('component:component-in-engine');

        assert.equal(stack.peek(), '"component:component-in-engine" (in "engine:my-engine")');

        stack.pop();
        stack.pop();
        let item = stack.pop();

        assert.equal(item, 'component:top-level-component');
        assert.equal(stack.peek(), '"template:application"');
      } else {
        assert.expect(0);
      }
    }
  }
);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/glimmer/tests/unit/utils/debug-stack-test.js