Skip to content

Instantly share code, notes, and snippets.

@MichalBryxi
Last active October 25, 2019 16:00
Show Gist options
  • Save MichalBryxi/38c0d213d262bf8196d2587b334c061d to your computer and use it in GitHub Desktop.
Save MichalBryxi/38c0d213d262bf8196d2587b334c061d to your computer and use it in GitHub Desktop.
ember-exam flaky tests
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
import Application from '../app';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import { assign } from '@ember/polyfills';
let attributes = assign({ rootElement: '#main' }, config.APP);
setApplication(Application.create(attributes));
start();
import { moduleFor, test } from 'ember-qunit';
let itemsFixture = [1,2,3];
moduleFor('controller:my-controller', 'TODO: put something here', {
});
test('first test', function(assert) {
let controller = this.subject();
assert.equal(itemsFixture.length, 3);
});
test('second test test', function(assert) {
let controller = this.subject();
itemsFixture.push(4);
assert.equal(itemsFixture.length, 4);
});
{
"version": "0.15.1",
"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.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment