Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

What to do with Qunit's default tests?

$
0
0

@Bauke wrote:

The Qunit tests that Ember generates contain some default tests, like:

// Acceptance test for route
test('visiting /login', function(assert) {
  visit('/login');

  andThen(function() {
    assert.equal(currentURL(), '/login');
  });
});

// Integration test for component
test('it renders', function(assert) {
  this.render(hbs`{{login-form}}`);
  assert.equal(this.$().text().trim(), '');
});

// Unit test for controller
test('it exists', function(assert) {
  let controller = this.subject();
  assert.ok(controller);
});

Ember usually adds the comment Replace this with your real tests. But then again, the default tests do test something (does it exist or will it render) and might be of value.

I'm new to testing and have just written my first tests. I'm just curious what you do with these default generated tests. Do you feel it's good practice to keep them there, or do you consider them pollution and remove them?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles