Skip to content

Commit 02c17f5

Browse files
committed
f
1 parent 4450b23 commit 02c17f5

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed

.oxlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,5 @@
137137
"jsdoc/require-returns": "allow",
138138
"jsdoc/require-param": "allow"
139139
},
140-
"ignorePatterns": ["index.d.ts", "test/fixtures/**"]
140+
"ignorePatterns": ["index.d.ts", "test/fixtures/**", "__snapshots__"]
141141
}

__snapshots__/mysql.test.ts.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
exports['test/mysql.test.ts should make default config stable 1'] = {
2+
"default": {
3+
"connectionLimit": 5
4+
},
5+
"app": true,
6+
"agent": true,
7+
"client": {
8+
"host": "127.0.0.1",
9+
"port": 3306,
10+
"user": "root",
11+
"password": "",
12+
"database": "test"
13+
}
14+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"egg": "^4.0.10",
4848
"oxlint": "^0.16.2",
4949
"rimraf": "6",
50+
"snap-shot-it": "^7.9.10",
5051
"tshy": "3",
5152
"tshy-after": "1",
5253
"typescript": "5"

test/mysql.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import path from 'node:path';
44
import fs from 'node:fs';
55
import { fileURLToPath } from 'node:url';
66

7+
import snapshot from 'snap-shot-it';
78
import { mm, type MockApplication } from '@eggjs/mock';
89

910
const __filename = fileURLToPath(import.meta.url);
@@ -44,6 +45,10 @@ describe('test/mysql.test.ts', () => {
4445

4546
afterEach(mm.restore);
4647

48+
it('should make default config stable', () => {
49+
snapshot(app.config.mysql);
50+
});
51+
4752
it('should query mysql user table success', () => {
4853
return app.httpRequest()
4954
.get('/')

0 commit comments

Comments
 (0)