@databases/mysql-test
Advanced tools
Comparing version
@@ -30,3 +30,3 @@ "use strict"; | ||
}; | ||
const params = parameter_reducers_1.startChain() | ||
const params = (0, parameter_reducers_1.startChain)() | ||
.addParam(parameter_reducers_1.param.flag(['-d', '--debug'], 'debug')) | ||
@@ -42,3 +42,3 @@ .addParam(parameter_reducers_1.param.string(['--image'], 'image')) | ||
async function runMigrationsAndAddToEnv(databaseURL, debug) { | ||
const config = mysql_config_1.getMySqlConfigSync(); | ||
const config = (0, mysql_config_1.getMySqlConfigSync)(); | ||
const DEFAULT_ENV_VAR = process.env.MYSQL_TEST_ENV_VAR || | ||
@@ -53,3 +53,3 @@ config.connectionStringEnvironmentVariable; | ||
if (typeof migrationsScript === 'string') { | ||
await modern_spawn_1.execBuffered(migrationsScript, { | ||
await (0, modern_spawn_1.execBuffered)(migrationsScript, { | ||
debug: debug || config.test.debug || false, | ||
@@ -59,3 +59,3 @@ }).getResult(); | ||
else { | ||
await modern_spawn_1.spawnBuffered(migrationsScript[0], migrationsScript.slice(1), { | ||
await (0, modern_spawn_1.spawnBuffered)(migrationsScript[0], migrationsScript.slice(1), { | ||
debug: debug || config.test.debug || false, | ||
@@ -67,3 +67,3 @@ }).getResult(); | ||
async function start(args) { | ||
const parseResult = parameter_reducers_1.parse(params, args); | ||
const parseResult = (0, parameter_reducers_1.parse)(params, args); | ||
if (!parseResult.valid) { | ||
@@ -78,3 +78,3 @@ console.error(parseResult.reason); | ||
ta.assert(); | ||
const { databaseURL } = await _1.default({ | ||
const { databaseURL } = await (0, _1.default)({ | ||
...parseResult.parsed, | ||
@@ -89,3 +89,3 @@ detached: true, | ||
async function run(args) { | ||
const parseResult = parameter_reducers_1.parse(params, args); | ||
const parseResult = (0, parameter_reducers_1.parse)(params, args); | ||
if (!parseResult.valid) { | ||
@@ -100,3 +100,3 @@ console.error(parseResult.reason); | ||
} | ||
const { databaseURL, kill } = await _1.default({ | ||
const { databaseURL, kill } = await (0, _1.default)({ | ||
...parseResult.parsed, | ||
@@ -106,3 +106,3 @@ detached: true, | ||
await runMigrationsAndAddToEnv(databaseURL, parseResult.parsed.debug); | ||
await modern_spawn_1.spawnBuffered(parseResult.rest[0], parseResult.rest.slice(1), { | ||
await (0, modern_spawn_1.spawnBuffered)(parseResult.rest[0], parseResult.rest.slice(1), { | ||
debug: true, | ||
@@ -114,7 +114,7 @@ }); | ||
exports.run = run; | ||
const stopParams = parameter_reducers_1.startChain() | ||
const stopParams = (0, parameter_reducers_1.startChain)() | ||
.addParam(parameter_reducers_1.param.flag(['-d', '--debug'], 'debug')) | ||
.addParam(parameter_reducers_1.param.string(['--containerName'], 'containerName')); | ||
async function stop(args) { | ||
const parseResult = parameter_reducers_1.parse(stopParams, args); | ||
const parseResult = (0, parameter_reducers_1.parse)(stopParams, args); | ||
if (!parseResult.valid) { | ||
@@ -129,3 +129,3 @@ console.error(parseResult.reason); | ||
ta.assert(); | ||
await _1.killDatabase({ | ||
await (0, _1.killDatabase)({ | ||
...parseResult.parsed, | ||
@@ -132,0 +132,0 @@ detached: true, |
@@ -7,3 +7,3 @@ "use strict"; | ||
const { createConnection } = require('mysql2'); | ||
const config = mysql_config_1.getMySqlConfigSync(); | ||
const config = (0, mysql_config_1.getMySqlConfigSync)(); | ||
const DEFAULT_MYSQL_DEBUG = !!process.env.MYSQL_TEST_DEBUG || config.test.debug; | ||
@@ -90,3 +90,3 @@ const DEFAULT_IMAGE = process.env.MYSQL_TEST_IMAGE || config.test.image; | ||
async function killDatabase(options = {}) { | ||
await with_container_1.killOldContainers({ | ||
await (0, with_container_1.killOldContainers)({ | ||
debug: DEFAULT_MYSQL_DEBUG, | ||
@@ -111,3 +111,3 @@ containerName: DEFAULT_CONTAINER_NAME, | ||
}; | ||
const { proc, externalPort, kill } = await with_container_1.default({ | ||
const { proc, externalPort, kill } = await (0, with_container_1.default)({ | ||
...rawOptions, | ||
@@ -114,0 +114,0 @@ internalPort: DEFAULT_MYSQL_PORT, |
@@ -7,3 +7,3 @@ "use strict"; | ||
const modern_spawn_1 = require("modern-spawn"); | ||
const config = mysql_config_1.getMySqlConfigSync(); | ||
const config = (0, mysql_config_1.getMySqlConfigSync)(); | ||
const DEFAULT_ENV_VAR = process.env.MYSQL_TEST_ENV_VAR || config.connectionStringEnvironmentVariable; | ||
@@ -21,3 +21,3 @@ exports.killers = []; | ||
} | ||
const { databaseURL, kill } = await __1.default(opts); | ||
const { databaseURL, kill } = await (0, __1.default)(opts); | ||
console.info(`Setting mysql connection string on environment: ${envVar}`); | ||
@@ -28,3 +28,3 @@ process.env[envVar] = databaseURL; | ||
if (typeof migrationsScript === 'string') { | ||
await modern_spawn_1.execBuffered(migrationsScript, { | ||
await (0, modern_spawn_1.execBuffered)(migrationsScript, { | ||
debug: opts.debug || | ||
@@ -36,3 +36,3 @@ (opts.debug === undefined && config.test.debug) || | ||
else { | ||
await modern_spawn_1.spawnBuffered(migrationsScript[0], migrationsScript.slice(1), { | ||
await (0, modern_spawn_1.spawnBuffered)(migrationsScript[0], migrationsScript.slice(1), { | ||
debug: opts.debug || | ||
@@ -39,0 +39,0 @@ (opts.debug === undefined && config.test.debug) || |
{ | ||
"name": "@databases/mysql-test", | ||
"version": "3.1.1", | ||
"version": "4.0.0-canary-1636", | ||
"description": "", | ||
@@ -11,4 +11,4 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@databases/mysql-config": "^2.0.0", | ||
"@databases/with-container": "^2.0.0", | ||
"@databases/mysql-config": "3.0.0-canary-1636", | ||
"@databases/with-container": "2.0.0", | ||
"modern-spawn": "^1.0.0", | ||
@@ -15,0 +15,0 @@ "ms": "^2.1.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
80480
-68.09%1
Infinity%+ Added
+ Added
- Removed
- Removed