Skip to content

Commit a04b930

Browse files
committed
feat: add unit test
1 parent b52a707 commit a04b930

File tree

8 files changed

+1291
-18
lines changed

8 files changed

+1291
-18
lines changed

.env.local.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# xmlrpc
2+
XMLRPC_API_URL=
3+
XMLRPC_USERNAME=
4+
XMLRPC_PASSWORD=

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ next-env.d.ts
3737
next.config.js
3838

3939
# JetBrains
40-
.idea
40+
.idea

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222
},
2323
"devDependencies": {
2424
"@next/font": "13.1.1",
25+
"@testing-library/react": "^14.0.0",
2526
"@types/node": "18.11.18",
2627
"@types/react": "18.0.26",
2728
"@types/react-dom": "18.0.10",
29+
"@vitejs/plugin-react": "^3.1.0",
2830
"esbuild": "^0.16.16",
2931
"eslint": "8.31.0",
3032
"eslint-config-next": "13.1.1",
33+
"jsdom": "^21.1.0",
3134
"prettier": "^2.8.2",
32-
"ts-loader": "^9.4.2"
35+
"ts-loader": "^9.4.2",
36+
"vitest": "^0.29.1"
3337
}
3438
}

pages/api/middleware/xmlrpc.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ export default async function handler(
3535

3636
let err
3737
try {
38-
// console.log("xmlrpcCORSParams.reqMethod=>")
39-
// console.log(xmlrpcCORSParams.reqMethod)
40-
// console.log("xmlrpcCORSParams.reqParams=>")
41-
// console.log(xmlrpcCORSParams.reqParams)
38+
// console.log("xmlrpcApiUrl=>", xmlrpcApiUrl)
39+
// console.log("xmlrpcCORSParams.reqMethod=>", xmlrpcCORSParams.reqMethod)
40+
// console.log("xmlrpcCORSParams.reqParams=>", xmlrpcCORSParams.reqParams)
4241

4342
const client = new SimpleXmlRpcClient(xmlrpcApiUrl)
4443

0 commit comments

Comments
 (0)