mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
test log messages
This commit is contained in:
3
integration-tests/jest.config.js
Normal file
3
integration-tests/jest.config.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
|
||||||
|
};
|
||||||
@@ -11,12 +11,9 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"wait:local": "cross-env DEVMODE=1 LOCALTEST=1 node wait.js",
|
"wait:local": "cross-env DEVMODE=1 LOCALTEST=1 node wait.js",
|
||||||
"wait:ci": "cross-env DEVMODE=1 CITEST=1 node wait.js",
|
"wait:ci": "cross-env DEVMODE=1 CITEST=1 node wait.js",
|
||||||
|
|
||||||
"test:local": "cross-env DEVMODE=1 LOCALTEST=1 jest",
|
"test:local": "cross-env DEVMODE=1 LOCALTEST=1 jest",
|
||||||
"test:local:path": "cross-env DEVMODE=1 LOCALTEST=1 jest --runTestsByPath __tests__/data-duplicator.spec.js",
|
"test:local:path": "cross-env DEVMODE=1 LOCALTEST=1 jest --runTestsByPath __tests__/data-duplicator.spec.js",
|
||||||
|
|
||||||
"test:ci": "cross-env DEVMODE=1 CITEST=1 jest --runInBand --json --outputFile=result.json --testLocationInResults",
|
"test:ci": "cross-env DEVMODE=1 CITEST=1 jest --runInBand --json --outputFile=result.json --testLocationInResults",
|
||||||
|
|
||||||
"run:local": "docker-compose down && docker-compose up -d && yarn wait:local && yarn test:local"
|
"run:local": "docker-compose down && docker-compose up -d && yarn wait:local && yarn test:local"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
@@ -24,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"jest": "^27.0.1"
|
"jest": "^27.0.1",
|
||||||
},
|
"pino-pretty": "^11.2.2"
|
||||||
"dependencies": {}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
integration-tests/setupTests.js
Normal file
22
integration-tests/setupTests.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const { prettyFactory } = require('pino-pretty');
|
||||||
|
|
||||||
|
const pretty = prettyFactory({
|
||||||
|
colorize: true,
|
||||||
|
translateTime: 'SYS:standard',
|
||||||
|
ignore: 'pid,hostname',
|
||||||
|
});
|
||||||
|
|
||||||
|
global.console = {
|
||||||
|
...console,
|
||||||
|
log: (...messages) => {
|
||||||
|
try {
|
||||||
|
const parsedMessage = JSON.parse(messages[0]);
|
||||||
|
process.stdout.write(pretty(parsedMessage) + '\n');
|
||||||
|
} catch (error) {
|
||||||
|
process.stdout.write(messages.join(' ') + '\n');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
debug: (...messages) => {
|
||||||
|
process.stdout.write(messages.join(' ') + '\n');
|
||||||
|
},
|
||||||
|
};
|
||||||
34
yarn.lock
34
yarn.lock
@@ -4072,7 +4072,7 @@ extsprintf@^1.2.0:
|
|||||||
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07"
|
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07"
|
||||||
integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==
|
integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA==
|
||||||
|
|
||||||
fast-copy@^3.0.0:
|
fast-copy@^3.0.0, fast-copy@^3.0.2:
|
||||||
version "3.0.2"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.2.tgz#59c68f59ccbcac82050ba992e0d5c389097c9d35"
|
resolved "https://registry.yarnpkg.com/fast-copy/-/fast-copy-3.0.2.tgz#59c68f59ccbcac82050ba992e0d5c389097c9d35"
|
||||||
integrity sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==
|
integrity sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==
|
||||||
@@ -4738,6 +4738,11 @@ help-me@^4.0.1:
|
|||||||
glob "^8.0.0"
|
glob "^8.0.0"
|
||||||
readable-stream "^3.6.0"
|
readable-stream "^3.6.0"
|
||||||
|
|
||||||
|
help-me@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/help-me/-/help-me-5.0.0.tgz#b1ebe63b967b74060027c2ac61f9be12d354a6f6"
|
||||||
|
integrity sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==
|
||||||
|
|
||||||
highlight.js@11.9.0:
|
highlight.js@11.9.0:
|
||||||
version "11.9.0"
|
version "11.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.9.0.tgz#04ab9ee43b52a41a047432c8103e2158a1b8b5b0"
|
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.9.0.tgz#04ab9ee43b52a41a047432c8103e2158a1b8b5b0"
|
||||||
@@ -8314,6 +8319,26 @@ pino-abstract-transport@^1.0.0:
|
|||||||
readable-stream "^4.0.0"
|
readable-stream "^4.0.0"
|
||||||
split2 "^4.0.0"
|
split2 "^4.0.0"
|
||||||
|
|
||||||
|
pino-pretty@^11.2.2:
|
||||||
|
version "11.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-11.2.2.tgz#5e8ec69b31e90eb187715af07b1d29a544e60d39"
|
||||||
|
integrity sha512-2FnyGir8nAJAqD3srROdrF1J5BIcMT4nwj7hHSc60El6Uxlym00UbCCd8pYIterstVBFlMyF1yFV8XdGIPbj4A==
|
||||||
|
dependencies:
|
||||||
|
colorette "^2.0.7"
|
||||||
|
dateformat "^4.6.3"
|
||||||
|
fast-copy "^3.0.2"
|
||||||
|
fast-safe-stringify "^2.1.1"
|
||||||
|
help-me "^5.0.0"
|
||||||
|
joycon "^3.1.1"
|
||||||
|
minimist "^1.2.6"
|
||||||
|
on-exit-leak-free "^2.1.0"
|
||||||
|
pino-abstract-transport "^1.0.0"
|
||||||
|
pump "^3.0.0"
|
||||||
|
readable-stream "^4.0.0"
|
||||||
|
secure-json-parse "^2.4.0"
|
||||||
|
sonic-boom "^4.0.1"
|
||||||
|
strip-json-comments "^3.1.1"
|
||||||
|
|
||||||
pino-pretty@^9.1.1:
|
pino-pretty@^9.1.1:
|
||||||
version "9.4.1"
|
version "9.4.1"
|
||||||
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-9.4.1.tgz#89121ef32d00a4d2e4b1c62850dcfff26f62a185"
|
resolved "https://registry.yarnpkg.com/pino-pretty/-/pino-pretty-9.4.1.tgz#89121ef32d00a4d2e4b1c62850dcfff26f62a185"
|
||||||
@@ -9490,6 +9515,13 @@ sonic-boom@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
atomic-sleep "^1.0.0"
|
atomic-sleep "^1.0.0"
|
||||||
|
|
||||||
|
sonic-boom@^4.0.1:
|
||||||
|
version "4.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-4.1.0.tgz#4f039663ba191fac5cfe4f1dc330faac079e4342"
|
||||||
|
integrity sha512-NGipjjRicyJJ03rPiZCJYjwlsuP2d1/5QUviozRXC7S3WdVWNK5e3Ojieb9CCyfhq2UC+3+SRd9nG3I2lPRvUw==
|
||||||
|
dependencies:
|
||||||
|
atomic-sleep "^1.0.0"
|
||||||
|
|
||||||
sorcery@^0.10.0:
|
sorcery@^0.10.0:
|
||||||
version "0.10.0"
|
version "0.10.0"
|
||||||
resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7"
|
resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7"
|
||||||
|
|||||||
Reference in New Issue
Block a user