Skip to content

Commit af62291

Browse files
committed
feat: tests
1 parent f27b17d commit af62291

11 files changed

+1087
-6
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,30 @@ The plugin's workflow is straightforward but powerful:
145145

146146
All generated hashes use the algorithm you specify (default: `sha256`). You can enable the "Prefixed Document Identifier" format (e.g., `sha256:abc123...`) for compliance with the [GraphQL over HTTP specification](https://github.com/graphql/graphql-over-http/blob/52d56fb36d51c17e08a920510a23bdc2f6a720be/spec/Appendix%20A%20--%20Persisted%20Documents.md#sha256-hex-document-identifier) by setting `includeAlgorithmPrefix: true`.
147147

148+
## Development
149+
150+
### Setup
151+
152+
```bash
153+
# Install dependencies
154+
pnpm install
155+
156+
# Watch mode for development
157+
pnpm dev
158+
```
159+
160+
### Testing
161+
162+
The plugin includes a comprehensive test suite built with Vitest:
163+
164+
```bash
165+
# Run tests
166+
pnpm test
167+
168+
# Run tests in watch mode
169+
pnpm test:watch
170+
```
171+
148172
## License
149173

150174
MIT

eslint.config.js eslint.config.mjs

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import tseslint from 'typescript-eslint';
33

44
export default tseslint.config(
55
eslint.configs.recommended,
6+
{
7+
ignores: ["dist/**/*", "eslint.config.mjs"],
8+
},
69
...tseslint.configs.strict,
710
...tseslint.configs.stylistic,
811
{
@@ -12,8 +15,4 @@ export default tseslint.config(
1215
},
1316
},
1417
},
15-
{
16-
ignores: ["dist/**/*"],
17-
files: ["**/*.ts"],
18-
},
1918
);

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"typecheck": "tsc --noEmit",
1616
"lint": "eslint . --ext .ts",
1717
"clean": "rm -rf dist",
18-
"prepare": "npm run build"
18+
"prepare": "npm run build",
19+
"test": "vitest run",
20+
"test:watch": "vitest"
1921
},
2022
"repository": {
2123
"type": "git",
@@ -51,6 +53,8 @@
5153
"eslint-plugin-prettier": "^5.2.3",
5254
"graphql": "^16.8.1",
5355
"prettier": "^3.5.3",
54-
"tsup": "^8.4.0"
56+
"tsup": "^8.4.0",
57+
"typescript-eslint": "^8.26.1",
58+
"vitest": "^3.0.9"
5559
}
5660
}

0 commit comments

Comments
 (0)