Connect, collaborate, and grow with a community of TypeScript developers
fix(challenge): gets challenge submission to work (#249)
Jim Burbridge946885e12fea
diff --git a/src/app/create/default-challenge.md b/src/app/create/default-challenge.mdindex a7993abf..4ea7eea2 100644--- a/src/app/create/default-challenge.md+++ b/src/app/create/default-challenge.md@@ -1,7 +1,9 @@// TEST CASE START (code in test cases are not editable)-Equal<Expected1, MyPick<Todo, 'title'>>()+type cases = [+ Expect<Equal<Expected1, MyPick<Todo, 'title'>>>,+ Expect<Equal<Expected2, MyPick<Todo, 'title' | 'completed'>>>+]-Equal<Expected2, MyPick<Todo, 'title' | 'completed'>>()// @ts-expect-errorMyPick<Todo, 'title' | 'completed' | 'invalid'>diff --git a/src/components/challenge/editor/index.tsx b/src/components/challenge/editor/index.tsxindex 2c06dcec..4883b8ff 100644--- a/src/components/challenge/editor/index.tsx+++ b/src/components/challenge/editor/index.tsx@@ -156,7 +156,7 @@ export const CodePanel = (props: Props) => {? () => {// check that it has some test cases// checks that there is a line that starts with Equal or Extends or NotEqual- if (!/(?:\n|^)\s*(?:Equal|Extends|NotEqual)</.test(code)) {+ if (!/(?:\n|^)\s*(?:Equal|Extends|NotEqual|Expect)</.test(code)) {toast({variant: 'destructive',title: 'You need to have test cases in your challenge',@@ -167,6 +167,7 @@ export const CodePanel = (props: Props) => {}const hasErrors = !!tsErrors[0].length;+ console.info(tsErrors);if (!hasErrors) {toast({