Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

fix(challenge) generic-function-arguments tests (#977)

Dimitri Mitropoulos675cf70a3fe4
diff --git a/challenges/generic-function-arguments/metadata.json b/challenges/generic-function-arguments/metadata.json
index 55bb1935..a78897a2 100644
--- a/challenges/generic-function-arguments/metadata.json
+++ b/challenges/generic-function-arguments/metadata.json
@@ -3,5 +3,5 @@
"label": "Generic Function Arguments",
"description": "Give generic function types to your functions",
"difficulty": "beginner",
- "prerequisites": ["generic-type-arguments"]
+ "prerequisites": ["generic-type-arguments", "literal-types"]
}
diff --git a/challenges/generic-function-arguments/tests.ts b/challenges/generic-function-arguments/tests.ts
index d275b76f..1d92d90a 100644
--- a/challenges/generic-function-arguments/tests.ts
+++ b/challenges/generic-function-arguments/tests.ts
@@ -1,4 +1,4 @@
-import { Expect, Equal } from 'type-testing';
+// import { Expect, Equal } from 'type-testing';
/** temporary */
const expect = <T>(a: T) => ({
@@ -6,24 +6,24 @@ const expect = <T>(a: T) => ({
});
const identity_string = identity("this is a string");
-expect(identity_string).toEqual("this is a ...");
+expect(identity_string).toEqual("this is a string");
type test_identity_string = Expect<Equal<
typeof identity_string,
- string
+ "this is a string"
>>;
const identity_number = identity(123.45);
expect(identity_number).toEqual(123.45);
type test_identity_number = Expect<Equal<
typeof identity_number,
- number
+ 123.45
>>;
const identity_boolean = identity(false);
expect(identity_boolean).toEqual(false);
type test_identity_boolean = Expect<Equal<
typeof identity_boolean,
- boolean
+ false
>>;
const strings = ['1', '1', '2', '3', '5'];