Skip to content

Instantly share code, notes, and snippets.

@rlivsey
Created July 11, 2018 15:45
Show Gist options
  • Save rlivsey/c8138b73e6e5775c92ff98f8d091227c to your computer and use it in GitHub Desktop.
Save rlivsey/c8138b73e6e5775c92ff98f8d091227c to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{#another-component}}
{{/another-component}}
import Resolver from '../../resolver';
import config from '../../config/environment';
const resolver = Resolver.create();
resolver.namespace = {
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix
};
export default resolver;
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import Component from '@ember/component';
module('Integration | Component | comment form', function(hooks) {
setupRenderingTest(hooks);
test('should render', async function(assert) {
this.owner.register('component:another-component', Component.extend({
layout: hbs`<p class="foo">hi</p>`
}));
await render(hbs`{{my-component}}`);
assert.equal(this.element.querySelector('.foo').textContent.trim(), 'hi');
});
});
import resolver from './helpers/resolver';
import {
setResolver
} from 'ember-qunit';
import { start } from 'ember-cli-qunit';
setResolver(resolver);
start();
{
"version": "0.15.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": true
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.2.2",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {
"ember-data": "3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment