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

Cleanup ember-template-compiler's tests #16010

Merged

Conversation

karthiicksiva
Copy link
Contributor

Related to #15988

QUnit.module('ember-template-compiler: assert-input-helper-without-block');
moduleFor('ember-template-compiler: assert-input-helper-without-block', class extends AbstractTestCase {
['@test Using {{#input}}{{/input}} is not valid'](assert) {
assert.expect(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the time we can get rid of assert.expect(1) and I believe we can in these test cases. We will want to keep the assert.expect(0) however

@karthiicksiva
Copy link
Contributor Author

@thoov
Copy link
Member

thoov commented Dec 21, 2017

@Karthiick There are a few approaches I can think of but this is what first pops to mind:

if (EMBER_GLIMMER_NAMED_ARGUMENTS) {

moduleFor('ember-template-compiler: assert-reserved-named-arguments', class extends TestCase  {

	 ['@test @arguments is reserved'](assert) {
	      assert.expectAssertion(() => {
	        compile('{{@arguments}}', { moduleName: 'baz/foo-bar' });
	      }, `'@arguments' is reserved. ('baz/foo-bar' @ L1:C2) `);
	
	      assert.expectAssertion(() => {
	        compile(`{{#if @arguments}}Yup{{/if}}`, { moduleName: 'baz/foo-bar' });
	      }, `'@arguments' is reserved. ('baz/foo-bar' @ L1:C6) `);
	
	      assert.expectAssertion(() => {
	        compile(`{{input type=(if @arguments "bar" "baz")}}`, { moduleName: 'baz/foo-bar'});
	      }, `'@arguments' is reserved. ('baz/foo-bar' @ L1:C17) `);
    }

  /* 
	... add a test property explicitly for each (I like this as its easier to grep vs saving a few lines):
    '@arguments',
    '@args',
    '@Arguments', '@Args',
    '@A', '@FOO', '@Foo',
    '@.', '@_', '@-', '@$'
*/
});

} else {

moduleFor('ember-template-compiler: assert-reserved-named-arguments', class extends TestCase {
	/*
	 Add the else tests here
	*/
});
	
}

Fix travis

Remove assert(1)

Rewrite assert-reserved-named-arguments  test as well
@karthiicksiva karthiicksiva changed the title [WIP] Cleanup ember-template-compiler's tests Cleanup ember-template-compiler's tests Dec 27, 2017
@karthiicksiva
Copy link
Contributor Author

Made the changes. @thoov @rwjblue

@rwjblue
Copy link
Member

rwjblue commented Dec 27, 2017

Thank you!

@rwjblue rwjblue merged commit 8a9f260 into emberjs:master Dec 27, 2017
@karthiicksiva karthiicksiva deleted the cleanup_ember_template_compiler branch December 27, 2017 22:40
@thoov thoov mentioned this pull request Jan 5, 2018
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants