Skip to content

Commit

Permalink
chore: replace jest with vitest (#628)
Browse files Browse the repository at this point in the history
* chore: replace jest with vitest

* minimal invasive change
  • Loading branch information
Uzlopak committed Jul 13, 2024
1 parent f96bf80 commit d7081ba
Show file tree
Hide file tree
Showing 9 changed files with 1,734 additions and 11,349 deletions.
13,027 changes: 1,710 additions & 11,317 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 4 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint": "prettier --check '{src,test,scripts}/**/*' '!scripts/generated/*' README.md package.json",
"lint:fix": "prettier --write '{src,test,scripts}/**/*' '!scripts/generated/*' README.md package.json",
"pretest": "npm run -s lint",
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest --coverage",
"test": "vitest run --coverage",
"test:ts": "npx tsc --noEmit --declaration --noUnusedLocals --allowImportingTsExtensions test/validate-typescript.ts",
"update-endpoints": "npm-run-all update-endpoints:*",
"update-endpoints:fetch-json": "node scripts/update-endpoints/fetch-json",
Expand All @@ -37,43 +37,17 @@
"@octokit/plugin-rest-endpoint-methods": "^13.0.0",
"@octokit/tsconfig": "^3.0.0",
"@types/fetch-mock": "^7.3.1",
"@types/jest": "^29.0.0",
"@types/node": "^20.0.0",
"@vitest/coverage-v8": "^2.0.2",
"esbuild": "^0.23.0",
"fetch-mock": "^10.0.0",
"github-openapi-graphql-query": "^4.0.0",
"glob": "^11.0.0",
"jest": "^29.0.0",
"npm-run-all2": "^6.0.0",
"prettier": "3.3.3",
"semantic-release-plugin-update-version-in-files": "^1.0.0",
"ts-jest": "^29.0.0",
"typescript": "^5.0.0"
},
"jest": {
"extensionsToTreatAsEsm": [
".ts"
],
"transform": {
"^.+\\.(ts|tsx)$": [
"ts-jest",
{
"tsconfig": "test/tsconfig.test.json",
"useESM": true
}
]
},
"coverageThreshold": {
"global": {
"statements": 100,
"branches": 100,
"functions": 100,
"lines": 100
}
},
"moduleNameMapper": {
"^(.+)\\.jsx?$": "$1"
}
"typescript": "^5.0.0",
"vitest": "^2.0.2"
},
"release": {
"branches": [
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Octokit } from "@octokit/core";
import * as OctokitTypes from "@octokit/types";
import type { Octokit } from "@octokit/core";
import type * as OctokitTypes from "@octokit/types";

export type {
EndpointOptions,
Expand Down
1 change: 1 addition & 0 deletions test/compose-paginate.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { test, expect } from "vitest";
import fetchMock from "fetch-mock";
import { Octokit } from "@octokit/core";

Expand Down
1 change: 1 addition & 0 deletions test/issues.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, test, expect } from "vitest";
import fetchMock from "fetch-mock";
import { Octokit } from "@octokit/core";
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
Expand Down
1 change: 1 addition & 0 deletions test/paginate.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import fetchMock from "fetch-mock";
import { Octokit } from "@octokit/core";
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
Expand Down
1 change: 1 addition & 0 deletions test/paginating-endpoints.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import { paginatingEndpoints, isPaginatingEndpoint } from "../src/index.ts";

describe("paginating endpoints", () => {
Expand Down
1 change: 1 addition & 0 deletions test/smoke.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, it, expect } from "vitest";
import { Octokit } from "@octokit/core";

import {
Expand Down
13 changes: 13 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from "vite";

export default defineConfig({
test: {
coverage: {
include: ["src/**/*.ts"],
reporter: ["html"],
thresholds: {
100: true,
},
},
},
});

0 comments on commit d7081ba

Please sign in to comment.