Skip to content

Commit 19fa332

Browse files
committed
chore: add tests
1 parent a0856c0 commit 19fa332

File tree

7 files changed

+870
-17
lines changed

7 files changed

+870
-17
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ logs/
1919
# IDE
2020
.vscode/
2121
.idea/
22+
23+
# Coverage reports
24+
coverage/

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,21 @@ export default defineConfig({
6262

6363
```ts
6464
export type Options = {
65-
name?: string; // selected template name, defaults to "default"
65+
/**
66+
* The name of the template to select.
67+
* If not provided, the first template will be used.
68+
*/
69+
name?: string;
70+
/**
71+
* The name of the template to use as a fallback if the primary is not found.
72+
* If not provided, the first template will be used.
73+
*/
74+
fallback?: string;
75+
/**
76+
* Whether to throw an error if the template is not found.
77+
* If false, a warning will be logged instead.
78+
*/
79+
strict?: boolean;
6680
};
6781
```
6882

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
],
2828
"scripts": {
2929
"build": "tsup",
30+
"test": "vitest",
31+
"coverage": "vitest run --coverage",
3032
"typecheck": "tsc --noEmit",
3133
"format": "prettier --write .",
3234
"prepublishOnly": "npm run build"
@@ -48,11 +50,13 @@
4850
"vue": "^3.5.17"
4951
},
5052
"devDependencies": {
53+
"@vitest/coverage-v8": "3.2.4",
5154
"prettier": "^3.6.2",
5255
"prettier-plugin-organize-imports": "^4.1.0",
5356
"tsup": "^8.5.0",
5457
"typescript": "^5.8.3",
5558
"vite": "^7.0.4",
59+
"vitest": "^3.2.4",
5660
"vue": "^3.5.17"
5761
}
5862
}

0 commit comments

Comments
 (0)