Skip to content

Cleanup ember-template-compiler's tests - #16010

Merged
rwjblue merged 1 commit into
emberjs:masterfrom
karthiicksiva:cleanup_ember_template_compiler
Dec 27, 2017
Merged

rwjblue merged 1 commit into
emberjs:masterfrom
karthiicksiva:cleanup_ember_template_compiler

Conversation

@karthiicksiva

Copy link
Copy Markdown
Contributor

Related to #15988

@karthiicksiva
karthiicksiva force-pushed the cleanup_ember_template_compiler branch from f9cdcb8 to 1e0128e Compare December 19, 2017 17:39
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
Copy Markdown
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
karthiicksiva force-pushed the cleanup_ember_template_compiler branch from 1e0128e to 48c2557 Compare December 21, 2017 14:34
@karthiicksiva

Copy link
Copy Markdown
Contributor Author

@thoov

thoov commented Dec 21, 2017 •

Copy link
Copy Markdown
Member

@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 force-pushed the cleanup_ember_template_compiler branch from 3829ebc to 7bd069a Compare December 27, 2017 16:48
@karthiicksiva karthiicksiva changed the title [WIP] Cleanup ember-template-compiler's tests Cleanup ember-template-compiler's tests Dec 27, 2017
@karthiicksiva

Copy link
Copy Markdown
Contributor Author

Made the changes. @thoov @rwjblue

@rwjblue

rwjblue commented Dec 27, 2017

Copy link
Copy Markdown
Member

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
13 of 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