- Welcome to the docks
+
This app is a ship builder for the game
@@ -25,47 +29,30 @@
Written by
Yanick Champoux
. Code available on
- Github
+ Github.
-
diff --git a/src/lib/components/About.test.js b/src/lib/components/About.test.js
new file mode 100644
index 0000000..e25dfe2
--- /dev/null
+++ b/src/lib/components/About.test.js
@@ -0,0 +1,11 @@
+import { test, expect } from "vitest";
+import { render } from "@testing-library/svelte";
+
+import About from "./About.svelte";
+
+test("version is present", () => {
+ import.meta.env.PACKAGE_VERSION = '1.2.3';
+ const { queryByText } = render(About);
+
+ expect(queryByText(/version 1.2.3/)).toBeTruthy();
+});
diff --git a/svelte.config.js b/svelte.config.js
index 8940ae6..da83039 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -8,6 +8,11 @@ export default {
adapter: adapter({ fallback: "index.html" }),
paths: { base: dev ? "" : "/aotds-docks" },
vite: {
+ define: {
+ "import.meta.env.PACKAGE_VERSION": JSON.stringify(
+ process.env.npm_package_version
+ ),
+ },
build: {
rollupOptions: {
plugins: [analyze()],