From ec9ef2c3024a3aae2e2e3a8a3dc7fbdcfe8f1625 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Thu, 7 Sep 2017 00:56:20 +0900 Subject: [PATCH] Add failure scenario Original properties must be kept! --- types/vfile/vfile-tests.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/vfile/vfile-tests.ts b/types/vfile/vfile-tests.ts index f81a15a24c..468e261801 100644 --- a/types/vfile/vfile-tests.ts +++ b/types/vfile/vfile-tests.ts @@ -24,6 +24,9 @@ file.message('`braavo` is misspelt; did you mean `bravo`?', {line: 1, column: 8} console.log(file.messages); -// Keep typings of custom data +// Typings of the custom data can be resolved from the parameters above const custom: string = file.custom; // 'Custom tango' const dataCustom: number = file.data.custom; // 12345 + +// Original properties must be kept +const fileWithWrongParams = vfile({ path: 1234 }); // $ExpectError