Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shouzhouServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjinjing
shouzhouServer
Commits
176e3a5b
Commit
176e3a5b
authored
Jul 05, 2024
by
Leo Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改README
parent
a553f6d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
README.md
README.md
+6
-0
utils.ts
src/__test__/utils.ts
+24
-0
No files found.
README.md
View file @
176e3a5b
...
@@ -33,6 +33,9 @@
...
@@ -33,6 +33,9 @@
2.
在根目录运行:
```npm install```
2.
在根目录运行:
```npm install```
3.
在VSCode编译器里按F5开始运行服务器
3.
在VSCode编译器里按F5开始运行服务器
## 测试
在根目录运行
```npm test```
## 错误代码:
## 错误代码:
-
501:数据Excel文件不在指定位置
-
501:数据Excel文件不在指定位置
-
502:数据Excel文件找不到需要的表格
-
502:数据Excel文件找不到需要的表格
...
@@ -82,6 +85,9 @@
...
@@ -82,6 +85,9 @@
2.
In the root directory, run
```npm install```
2.
In the root directory, run
```npm install```
3.
Using VScode IDE, press F5 to start the server.
3.
Using VScode IDE, press F5 to start the server.
## Testing
Run
```npm test```
in the root directory
## Error Code:
## Error Code:
-
501: The Excel file storing the data is missing
-
501: The Excel file storing the data is missing
-
502: The Excel sheet doesn't exist in the Excel file (Excel file is corrupted)
-
502: The Excel sheet doesn't exist in the Excel file (Excel file is corrupted)
...
...
src/__test__/utils.ts
0 → 100644
View file @
176e3a5b
export
function
testDateError
(
strategy
)
{
expect
(()
=>
strategy
.
execute
()).
toThrow
(
"Date parameter is required."
);
expect
(()
=>
strategy
.
execute
({})).
toThrow
(
"Date parameter is required."
);
expect
(()
=>
strategy
.
execute
({
query
:
{}
})).
toThrow
(
"Date parameter is required."
);
}
export
function
testSightError
(
strategy
)
{
expect
(()
=>
strategy
.
execute
()).
toThrow
(
"Date and sight parameters are required."
);
expect
(()
=>
strategy
.
execute
({})).
toThrow
(
"Date and sight parameters are required."
);
expect
(()
=>
strategy
.
execute
({
query
:
{}
})).
toThrow
(
"Date and sight parameters are required."
);
expect
(()
=>
strategy
.
execute
({
query
:
{
date
:
'2023-07-01'
}
})).
toThrow
(
'Date and sight parameters are required.'
);
expect
(()
=>
strategy
.
execute
({
query
:
{
sight
:
'SomeSight'
}
})).
toThrow
(
'Date and sight parameters are required.'
);
}
export
function
testYearError
(
strategy
)
{
expect
(()
=>
strategy
.
execute
()).
toThrow
(
"Year parameter is required."
);
expect
(()
=>
strategy
.
execute
({})).
toThrow
(
"Year parameter is required."
);
expect
(()
=>
strategy
.
execute
({
query
:
{}
})).
toThrow
(
"Year parameter is required."
);
}
export
function
testStrategy
(
strategy
,
params
,
truthValue
)
{
expect
(
strategy
.
execute
(
params
)).
toEqual
(
truthValue
);
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment