From 170a11b2727eeb8cd4dbad80e205e6b57c79b64e Mon Sep 17 00:00:00 2001 From: Mike North Date: Tue, 18 Sep 2018 09:41:10 -0700 Subject: [PATCH] [@ember/string] Tests for handlebars SafeString consistency --- types/ember__string/ember__string-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/ember__string/ember__string-tests.ts b/types/ember__string/ember__string-tests.ts index f9f7dbef50..1f045b849d 100644 --- a/types/ember__string/ember__string-tests.ts +++ b/types/ember__string/ember__string-tests.ts @@ -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