Sha256: 62e6337abcbcc6e9da4ce7bdabef0bfb3a94f444becb11df27224eb4ef7c29be

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

import { DebugStack } from 'ember-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

2 entries across 2 versions & 1 rubygems

Version Path
discourse-ember-source-3.5.1.1 dist/es/ember-glimmer/tests/unit/utils/debug-stack-test.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-glimmer/tests/unit/utils/debug-stack-test.js