From 0e6427f2bc69aae2000ba924df9fdbd8837281e4 Mon Sep 17 00:00:00 2001 From: Zheeeng Date: Tue, 4 Aug 2020 21:11:39 +0800 Subject: [PATCH] fix: testcase (#41) --- questions/18-easy-tuple-length/README.md | 8 ++++---- questions/18-easy-tuple-length/test-cases.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/questions/18-easy-tuple-length/README.md b/questions/18-easy-tuple-length/README.md index 9c632b95..96b3451f 100644 --- a/questions/18-easy-tuple-length/README.md +++ b/questions/18-easy-tuple-length/README.md @@ -5,11 +5,11 @@ For given a tuple, you need create a generic `Length`, pick the length of the tu For example ```ts -type tesla = ['tesla', 'model 3', 'model X', 'model Y'] -type spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT'] +type tesla = ['tesla', 'model 3', 'model X', 'model Y'] as const +type spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT'] as const -type teslaLength = Length // expected 4 -type spaceXLength = Length // expected 5 +type teslaLength = Length // expected 4 +type spaceXLength = Length // expected 5 ```
Back Share your Solutions Check out Solutions diff --git a/questions/18-easy-tuple-length/test-cases.ts b/questions/18-easy-tuple-length/test-cases.ts index c84684e3..4ef158b1 100644 --- a/questions/18-easy-tuple-length/test-cases.ts +++ b/questions/18-easy-tuple-length/test-cases.ts @@ -1,9 +1,9 @@ import { Equal, Expect } from '@type-challenges/utils' -const tesla = ['tesla', 'model 3', 'model X', 'model Y'] -const spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT'] +const tesla = ['tesla', 'model 3', 'model X', 'model Y'] as const +const spaceX = ['FALCON 9', 'FALCON HEAVY', 'DRAGON', 'STARSHIP', 'HUMAN SPACEFLIGHT'] as const type cases = [ - Expect, 4>>, - Expect, 5>>, + Expect, 4>>, + Expect, 5>>, ]