-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from GuoXiCheng/main
publish 1.0.23
- Loading branch information
Showing
42 changed files
with
1,222 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,3 +130,5 @@ dist | |
.pnp.* | ||
|
||
lib | ||
src/__tests__/mock/json/*.json | ||
!src/__tests__/mock/json/mock*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
module.exports = { | ||
testTimeout: 120000, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
collectCoverageFrom: [ | ||
"src/**/*.ts", // 包括 src 目录下所有的 TypeScript 文件 | ||
"!src/**/*.d.ts", // 排除 TypeScript 声明文件 | ||
"!src/__tests__/**/*.ts" | ||
], | ||
testMatch: ["<rootDir>/src/__tests__/**/*.test.ts"] | ||
}; | ||
module.exports = { | ||
testTimeout: 30000, | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
collectCoverageFrom: [ | ||
"src/**/*.ts", // 包括 src 目录下所有的 TypeScript 文件 | ||
"!src/**/*.d.ts", // 排除 TypeScript 声明文件 | ||
"!src/__tests__/**/*.ts" | ||
], | ||
testMatch: ["<rootDir>/src/__tests__/*.test.ts"], | ||
testPathIgnorePatterns: [] | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,39 @@ | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import babel from '@rollup/plugin-babel'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import babel from "@rollup/plugin-babel"; | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import json from "@rollup/plugin-json"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import dts from "rollup-plugin-dts"; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
output: [ | ||
{ | ||
file: 'dist/bundle.cjs.js', // CommonJS 输出文件 | ||
format: 'cjs', | ||
}, | ||
{ | ||
file: 'dist/bundle.esm.js', // ES Module 输出文件 | ||
format: 'esm', | ||
}, | ||
], | ||
plugins: [ | ||
typescript({ include: ['./src/**/*.ts'] }), | ||
babel({ | ||
babelHelpers: 'bundled', | ||
extensions: ['.ts', '.tsx'], | ||
presets: ['@babel/preset-env', '@babel/preset-typescript'], | ||
}), | ||
nodeResolve(), | ||
commonjs(), | ||
json() | ||
] | ||
}; | ||
export default [ | ||
{ | ||
input: "src/index.ts", | ||
output: [ | ||
{ | ||
file: "dist/bundle.cjs.js", // CommonJS 输出文件 | ||
format: "cjs", | ||
}, | ||
{ | ||
file: "dist/bundle.esm.js", // ES Module 输出文件 | ||
format: "esm", | ||
}, | ||
], | ||
plugins: [ | ||
typescript({ include: ["./src/**/*.ts"] }), | ||
babel({ | ||
babelHelpers: "bundled", | ||
extensions: [".ts", ".tsx"], | ||
presets: ["@babel/preset-env", "@babel/preset-typescript"], | ||
}), | ||
nodeResolve(), | ||
commonjs(), | ||
json(), | ||
], | ||
}, | ||
/* 单独生成声明文件 */ | ||
{ | ||
input: "dist/types/index.d.ts", | ||
output: [{ file: "dist/index.d.ts", format: "es" }], | ||
plugins: [dts()], | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
import { giteeRequest } from "./helper/helper"; | ||
import { USE_API, giteeRequest } from './helper/helper'; | ||
import { mockGiteeUser } from './mock/mock-git-user'; | ||
|
||
describe('Test Authenticate Gitee', () => { | ||
test('Test Authenticate Gitee', async () => { | ||
const res = await giteeRequest.authenticate(); | ||
expect(Object.keys(res)).toEqual([ | ||
'id', 'login', | ||
'name', 'avatar_url', | ||
'url', 'html_url', | ||
'remark', 'followers_url', | ||
'following_url', 'gists_url', | ||
'starred_url', 'subscriptions_url', | ||
'organizations_url', 'repos_url', | ||
'events_url', 'received_events_url', | ||
'type', 'blog', | ||
'weibo', 'bio', | ||
'public_repos', 'public_gists', | ||
'followers', 'following', | ||
'stared', 'watched', | ||
'created_at', 'updated_at', | ||
'email' | ||
]) | ||
}); | ||
beforeAll(()=>{ | ||
if (USE_API) return; | ||
mockGiteeUser(); | ||
}); | ||
|
||
test('Test Authenticate Gitee', async () => { | ||
const res = await giteeRequest.authenticate(); | ||
expect(Object.keys(res)).toEqual([ | ||
'id', 'login', | ||
'name', 'avatar_url', | ||
'url', 'html_url', | ||
'remark', 'followers_url', | ||
'following_url', 'gists_url', | ||
'starred_url', 'subscriptions_url', | ||
'organizations_url', 'repos_url', | ||
'events_url', 'received_events_url', | ||
'type', 'blog', | ||
'weibo', 'bio', | ||
'public_repos', 'public_gists', | ||
'followers', 'following', | ||
'stared', 'watched', | ||
'created_at', 'updated_at', | ||
'email' | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.