Skip to content

Commit e1a1448

Browse files
authored
Merge pull request #38 from givery-technology/dev/2.5.0
Features and tests for v2.5.0
2 parents 31b818b + 379034c commit e1a1448

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2607
-5332
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ trim_trailing_whitespace = true
1010
[package.json]
1111
indent_style = space
1212
indent_size = 2
13+
14+
[*.yml]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.md]
19+
indent_style = space
20+
indent_size = 2

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [14.x, 16.x, 18.x, 20.x]
12+
node-version: [16.x, 18.x, 20.x]
1313

1414
steps:
1515
- uses: actions/checkout@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
db.sqlite

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ This software is released under the [MIT License](LICENSE).
1515

1616
## Release Note
1717

18+
### Version 2.5.0
19+
20+
* [Feat] Allow multiple checks in a single testcase (Runner)
21+
* [Feat] Checks for record length (Runner)
22+
* [Feat] Checks for table schema (API / Runner)
23+
* [Feat] Checks for auto increment (API / Runner)
24+
* [Feat] Checks for last executed SQL (Runner)
25+
* [Feat] Prechecks: `column` / `without` (Runner)
26+
* [Feat] Multiple test case generation with a simple template engine
27+
* [Feat] Performance check (Runner)
28+
* [Feat] Checks for column list (Runner)
29+
* [Feat] Combine multiple checks into one testcase (Runner)
30+
1831
### Version 2.4.0
1932

2033
* [Feat] Improve error message in `recordEqual` processing when column names are different.
2134
* [Security] Security updates
22-
35+
2336
### Version 2.3.1
2437

2538
* [Bugfix] The `precheck` process in handling whitespace.

doc/API.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ console.log(sql); // EXPLAIN QUERY PLAN SELECT * AS count FROM emp
5252

5353
Loads records from CSV and inserts them into the given table
5454

55+
#### async `Connection#tableSchema(table)`
56+
57+
Queries the table schema.
58+
59+
```javascript
60+
const columns = await conn.tableSchema("my_table");
61+
columns.forEach(({order, name, type}) => console.log(name));
62+
```
63+
5564
### `records` module
5665

5766
Utility for query result records
@@ -195,7 +204,7 @@ expect([
195204
]);
196205
```
197206

198-
#### `recordEqualToCsv(path, opt_message)
207+
#### `recordEqualToCsv(path, opt_message)`
199208

200209
Target will be loaded from CSV file.
201210

@@ -211,6 +220,28 @@ empno,deptno,name
211220
1,10,Scott
212221
```
213222

223+
#### `recordContain(value)`
224+
225+
Asserts if the records contain the given value.
226+
227+
```javascript
228+
expect([
229+
{ name: "John", age: 24, sex: "male" },
230+
{ name: "Karen", age: 21, sex: "female" },
231+
]).to.recordContain(
232+
{ name: "John", age: 24, sex: "male" },
233+
);
234+
```
235+
236+
`recordContain` supports function matching.
237+
238+
```javascript
239+
expect([
240+
{ name: "John", age: 24, sex: "male" },
241+
{ name: "Karen", age: 21, sex: "female" },
242+
]).to.recordContain(r => r.age === 24);
243+
```
244+
214245
#### `columns(xs)`
215246

216247
Retains given column(s) from actual records (no assertion)

0 commit comments

Comments
 (0)