Skip to content

Commit

Permalink
tests: add cli unit tests (#719)
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemaker1 committed Jul 18, 2022
1 parent f8abc37 commit 36d60e7
Show file tree
Hide file tree
Showing 27 changed files with 1,496 additions and 193 deletions.
16 changes: 16 additions & 0 deletions config/vitest.ts
@@ -0,0 +1,16 @@
// config/vitest.ts
// The vitest configuration file.

import { env } from 'node:process';
import { defineConfig } from 'vitest/config';

// Make sure the output of the CLI is in color, so that it matches the
// snapshots.
env.FORCE_COLOR = 2;

export default defineConfig({
test: {
// Collect coverage using C8.
coverage: { enabled: true },
},
});
12 changes: 9 additions & 3 deletions package.json
Expand Up @@ -25,7 +25,9 @@
"start": "node ./build/main.js",
"compile": "tsup ./source/main.ts",
"test:tsc": "tsc --project tsconfig.json",
"test": "pnpm test:tsc",
"test:unit": "vitest run --config config/vitest.ts",
"test:watch": "vitest watch --config config/vitest.ts",
"test": "pnpm test:tsc && pnpm test:unit",
"lint:code": "eslint --max-warnings 0 source/**/*.ts",
"lint:style": "prettier --check --ignore-path .gitignore .",
"lint": "pnpm lint:code && pnpm lint:style",
Expand All @@ -37,6 +39,7 @@
"ajv": "8.11.0",
"arg": "5.0.2",
"boxen": "7.0.0",
"c8": "7.11.3",
"chalk": "5.0.1",
"chalk-template": "0.4.0",
"clipboardy": "3.0.0",
Expand All @@ -50,12 +53,14 @@
"@types/serve-handler": "6.1.1",
"@vercel/style-guide": "3.0.0",
"eslint": "8.19.0",
"got": "12.1.0",
"husky": "8.0.1",
"lint-staged": "13.0.3",
"prettier": "2.7.1",
"tsup": "6.1.3",
"tsx": "3.7.1",
"typescript": "4.6.4"
"typescript": "4.6.4",
"vitest": "0.18.0"
},
"tsup": {
"target": "esnext",
Expand All @@ -79,7 +84,8 @@
"prettier --ignore-unknown --write"
],
"source/**/*.ts": [
"eslint --max-warnings 0 --fix"
"eslint --max-warnings 0 --fix",
"vitest related --run"
]
}
}

0 comments on commit 36d60e7

Please sign in to comment.