Skip to content

Commit

Permalink
Avoid assertions for Symbol when not present.
Browse files Browse the repository at this point in the history
Co-authored-by: Godfrey Chan <[email protected]>
  • Loading branch information
rwjblue and chancancode committed Jul 31, 2019
1 parent 253f177 commit cf09c0e
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
import { Component, compile } from '../../utils/helpers';
import { setComponentTemplate, getComponentTemplate } from '../../..';

const hasSymbol = typeof Symbol !== 'undefined';

if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
if (EMBER_MODULE_UNIFICATION) {
moduleFor(
Expand Down Expand Up @@ -74,9 +76,11 @@ if (EMBER_GLIMMER_SET_COMPONENT_TEMPLATE) {
setComponentTemplate(compile('foo'), 'foo');
}, /Cannot call `setComponentTemplate` on `foo`/);

expectAssertion(() => {
setComponentTemplate(compile('foo'), Symbol('foo'));
}, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
if (hasSymbol) {
expectAssertion(() => {
setComponentTemplate(compile('foo'), Symbol('foo'));
}, /Cannot call `setComponentTemplate` on `Symbol\(foo\)`/);
}
}

'@test calling it twice on the same object asserts'() {
Expand Down

0 comments on commit cf09c0e

Please sign in to comment.