[@ember/string] Tests for handlebars SafeString consistency

This commit is contained in:
Mike North
2018-09-18 09:41:10 -07:00
parent b697ec8a1b
commit 170a11b272
@@ -1,4 +1,5 @@
import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w } from '@ember/string';
import { SafeString } from 'handlebars';
dasherize(); // $ExpectError
dasherize('blue man group'); // $ExpectType string
@@ -31,3 +32,7 @@ capitalize('', ''); // $ExpectError
loc(); // $ExpectError
loc("_Hello World"); // $ExpectType string
loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string
const handlebarsSafeString: SafeString = htmlSafe('lorem ipsum...');
htmlSafe('lorem ipsum...'); // $ExpectType SafeString
const regularString: string = htmlSafe('lorem ipsum...'); // $ExpectError