Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to QUnit 2.0 compatible output. #3197

Merged
merged 2 commits into from Feb 4, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -3,19 +3,20 @@ import startApp from '../helpers/start-app';

var application;

module('Acceptance: <%= classifiedModuleName %>', {
setup: function() {
QUnit.module('Acceptance: <%= classifiedModuleName %>', {
beforeEach: function() {
application = startApp();
},
teardown: function() {

afterEach: function() {
Ember.run(application, 'destroy');
}
});

test('visiting /<%= dasherizedModuleName %>', function() {
QUnit.test('visiting /<%= dasherizedModuleName %>', function(assert) {
visit('/<%= dasherizedModuleName %>');

andThen(function() {
equal(currentPath(), '<%= dasherizedModuleName %>');
assert.equal(currentPath(), '<%= dasherizedModuleName %>');
});
});
@@ -9,7 +9,7 @@ moduleFor('adapter:<%= dasherizedModuleName %>', '<%= classifiedModuleName %>Ada
});

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {

This comment has been minimized.

Copy link
@jakecraige

jakecraige Feb 3, 2015

Member

Does this and the other places need to be QUnit.test ?

This comment has been minimized.

Copy link
@rwjblue

rwjblue Feb 4, 2015

Author Member

Test is imported from ember-qunit here, so no.

var adapter = this.subject();
ok(adapter);
assert.ok(adapter);
});
@@ -10,7 +10,7 @@
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.0",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "rwjblue/ember-qunit-builds#0.2.1",
"ember-qunit": "rwjblue/ember-qunit-builds#0.2.4",
"ember-qunit-notifications": "0.0.5",
"qunit": "~1.17.1"
}
@@ -9,26 +9,6 @@
"QUnit",
"define",
"console",
"equal",
"notEqual",
"notStrictEqual",
"test",
"asyncTest",
"testBoth",
"testWithDefault",
"raises",
"throws",
"deepEqual",
"start",
"stop",
"ok",
"strictEqual",
"module",
"moduleFor",
"moduleForComponent",
"moduleForModel",
"process",
"expect",
"visit",
"exists",
"fillIn",
@@ -39,8 +19,6 @@
"findWithAssert",
"wait",
"DS",
"isolatedContainer",
"startApp",
"andThen",
"currentURL",
"currentPath",
@@ -8,14 +8,14 @@ moduleForComponent('<%= dasherizedModuleName %>', {
// needs: ['component:foo', 'helper:bar']
});

test('it renders', function() {
expect(2);
test('it renders', function(assert) {
assert.expect(2);

// creates the component instance
var component = this.subject();
equal(component._state, 'preRender');
assert.equal(component._state, 'preRender');

// renders the component to the page
this.render();
equal(component._state, 'inDOM');
assert.equal(component._state, 'inDOM');
});
@@ -9,7 +9,7 @@ moduleFor('controller:<%= dasherizedModuleName %>', {
});

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {
var controller = this.subject();
ok(controller);
assert.ok(controller);
});
@@ -2,10 +2,10 @@ import {
<%= camelizedModuleName %>
} from '../../../helpers/<%= dasherizedModuleName %>';

module('<%= classifiedModuleName %>Helper');
QUnit.module('<%= classifiedModuleName %>Helper');

// Replace this with your real tests.
test('it works', function() {
QUnit.test('it works', function(assert) {
var result = <%= camelizedModuleName %>(42);
ok(result);
assert.ok(result);
});
@@ -3,8 +3,8 @@ import { initialize } from '../../../initializers/<%= dasherizedModuleName %>';

var container, application;

module('<%= classifiedModuleName %>Initializer', {
setup: function() {
QUnit.module('<%= classifiedModuleName %>Initializer', {
beforeEach: function() {
Ember.run(function() {
application = Ember.Application.create();
container = application.__container__;
@@ -14,10 +14,9 @@ module('<%= classifiedModuleName %>Initializer', {
});

// Replace this with your real tests.
test('it works', function() {
QUnit.test('it works', function(assert) {
initialize(container, application);

// you would normally confirm the results of the initializer here
ok(true);
assert.ok(true);
});

@@ -1,11 +1,11 @@
import Ember from 'ember';
import <%= classifiedModuleName %>Mixin from '../../../mixins/<%= dasherizedModuleName %>';

module('<%= classifiedModuleName %>Mixin');
QUnit.module('<%= classifiedModuleName %>Mixin');

// Replace this with your real tests.
test('it works', function() {
QUnit.test('it works', function(assert) {
var <%= classifiedModuleName %>Object = Ember.Object.extend(<%= classifiedModuleName %>Mixin);
var subject = <%= classifiedModuleName %>Object.create();
ok(subject);
assert.ok(subject);
});
@@ -8,8 +8,8 @@ moduleForModel('<%= dasherizedModuleName %>', {
<%= typeof needs !== 'undefined' ? needs : '' %>
});

test('it exists', function() {
test('it exists', function(assert) {
var model = this.subject();
// var store = this.store();
ok(!!model);
assert.ok(!!model);
});
@@ -8,7 +8,7 @@ moduleFor('route:<%= dasherizedModuleName %>', {
// needs: ['controller:foo']
});

test('it exists', function() {
test('it exists', function(assert) {
var route = this.subject();
ok(route);
assert.ok(route);
});
@@ -9,7 +9,7 @@ moduleFor('serializer:<%= dasherizedModuleName %>', {
});

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {
var serializer = this.subject();
ok(serializer);
assert.ok(serializer);
});
@@ -9,7 +9,7 @@ moduleFor('service:<%= dasherizedModuleName %>', {
});

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {
var service = this.subject();
ok(service);
assert.ok(service);
});
@@ -9,7 +9,7 @@ moduleFor('transform:<%= dasherizedModuleName %>', {
});

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {
var transform = this.subject();
ok(transform);
assert.ok(transform);
});
@@ -1,9 +1,9 @@
import <%= camelizedModuleName %> from '../../../utils/<%= dasherizedModuleName %>';

module('<%= camelizedModuleName %>');
QUnit.module('<%= camelizedModuleName %>');

// Replace this with your real tests.
test('it works', function() {
QUnit.test('it works', function(assert) {
var result = <%= camelizedModuleName %>();
ok(result);
assert.ok(result);
});
@@ -6,7 +6,7 @@ import {
moduleFor('view:<%= dasherizedModuleName %>');

// Replace this with your real tests.
test('it exists', function() {
test('it exists', function(assert) {
var view = this.subject();
ok(view);
assert.ok(view);
});
@@ -3,29 +3,29 @@ import startApp from '../helpers/start-app';

var application;

module('Acceptance', {
setup: function() {
QUnit.module('Acceptance', {
beforeEach: function() {
application = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(application, 'destroy');
}
});

test('renders properly', function() {
QUnit.test('renders properly', function(assert) {
visit('/');

andThen(function() {
var element = find('.basic-thing');
equal(element.first().text().trim(), 'WOOT!!');
assert.equal(element.first().text().trim(), 'WOOT!!');
});
});

test('renders imported component', function() {
QUnit.test('renders imported component', function(assert) {
visit('/');

andThen(function() {
var element = find('.second-thing');
equal(element.first().text().trim(), 'SECOND!!');
assert.equal(element.first().text().trim(), 'SECOND!!');
});
});
@@ -1,6 +1,8 @@
/*jshint strict:false */
/* globals QUnit */

import config from '../../config/environment';

test('the correct config is used', function() {
equal(config.fileUsed, 'config/something-else.js');
QUnit.test('the correct config is used', function(assert) {
assert.equal(config.fileUsed, 'config/something-else.js');
});
@@ -1,27 +1,27 @@
/*jshint strict:false */
/* globals test, expect, equal, visit, andThen */
/* globals QUnit, visit, andThen */

import Ember from 'ember';
import startApp from '../helpers/start-app';

var application;

module('default-development - Integration', {
setup: function() {
QUnit.module('default-development - Integration', {
beforeEach: function() {
application = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(application, 'destroy');
}
});


test('the application boots properly', function() {
expect(1);
QUnit.test('the application boots properly', function(assert) {
assert.expect(1);

visit('/');

andThen(function() {
equal(Ember.$('#title').text(), 'Welcome to Ember.js');
assert.equal(Ember.$('#title').text(), 'Welcome to Ember.js');
});
});
@@ -1,27 +1,27 @@
/*jshint strict:false */
/* globals test, expect, equal, visit, andThen */
/* globals QUnit, visit, andThen */

import Ember from 'ember';
import startApp from '../helpers/start-app';

var application;

module('pods based templates', {
setup: function() {
QUnit.module('pods based templates', {
beforeEach: function() {
application = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(application, 'destroy');
}
});


test('the application boots properly with pods based templates', function() {
expect(1);
QUnit.test('the application boots properly with pods based templates', function(assert) {
assert.expect(1);

visit('/');

andThen(function() {
equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
});
});
@@ -1,27 +1,27 @@
/*jshint strict:false */
/* globals test, expect, equal, visit, andThen */
/* globals QUnit, visit, andThen */

import Ember from 'ember';
import startApp from '../helpers/start-app';

var application;

module('pods based templates', {
setup: function() {
QUnit.module('pods based templates', {
beforeEach: function() {
application = startApp();
},
teardown: function() {
afterEach: function() {
Ember.run(application, 'destroy');
}
});


test('the application boots properly with pods based templates with a podModulePrefix set', function() {
expect(1);
QUnit.test('the application boots properly with pods based templates with a podModulePrefix set', function(assert) {
assert.expect(1);

visit('/');

andThen(function() {
equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
});
});
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.