From 9e8787b5a63489c3e1fb937f98795b5562dbd2a3 Mon Sep 17 00:00:00 2001 From: Edoardo Scibona <12040076+velut@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:19:59 +0200 Subject: [PATCH] test: add test for assertValidPackageName --- src/assert-valid-package-name.test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/assert-valid-package-name.test.ts diff --git a/src/assert-valid-package-name.test.ts b/src/assert-valid-package-name.test.ts new file mode 100644 index 0000000..e913bda --- /dev/null +++ b/src/assert-valid-package-name.test.ts @@ -0,0 +1,8 @@ +import { expect, test } from "vitest"; +import { assertValidPackageName } from "./assert-valid-package-name"; + +test("assertValidPackageName", () => { + expect(() => assertValidPackageName("")).toThrow(); + expect(() => assertValidPackageName("foo")).not.toThrow(); + expect(() => assertValidPackageName("@foo/bar")).not.toThrow(); +});