diff --git a/deno.json b/deno.json index 12e76ba..234ba73 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,7 @@ { "name": "@tyler/enum", "description": "replacement for typescript enums", - "version": "0.2.5", + "version": "0.2.6", "repository": { "type": "git", "url": "git+https://github.com/tylersayshi/enum.git" diff --git a/index.test.ts b/index.test.ts index 84d3e6b..31803e0 100644 --- a/index.test.ts +++ b/index.test.ts @@ -8,6 +8,13 @@ Deno.test(function testNumEnum() { assertEquals(colors.blue, 2); }); +Deno.test(function testNumEnum() { + const colors = numEnum(["one", "one"]); + + // @ts-expect-error cannot assign to never + const _foo: typeof colors = 0; +}); + Deno.test(function testStringEnum() { const animals = stringEnum(["cat", "dog", "bird"]); assertEquals(animals.cat, "cat");