Comparing version 0.0.78 to 0.0.79
{ | ||
"name": "@lbu/cli", | ||
"version": "0.0.78", | ||
"version": "0.0.79", | ||
"description": "CLI containing utilities and simple script runner", | ||
@@ -30,4 +30,4 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@lbu/insight": "0.0.78", | ||
"@lbu/stdlib": "0.0.78", | ||
"@lbu/insight": "0.0.79", | ||
"@lbu/stdlib": "0.0.79", | ||
"c8": "7.3.1", | ||
@@ -59,3 +59,3 @@ "chokidar": "3.4.2", | ||
}, | ||
"gitHead": "9ea11a8ce0e17e7823ff11cac7e06db2960f33e2" | ||
"gitHead": "c8f13508e33887b1c9ac6586c4cc1aa906c0a121" | ||
} |
@@ -58,2 +58,3 @@ import { AssertionError, deepStrictEqual } from "assert"; | ||
setTestTimeout(runner.timeout ?? timeout); | ||
mutateRunnerEnablingWarnings(runner); | ||
@@ -90,2 +91,32 @@ for (const child of testState.children) { | ||
/** | ||
* Wrap runner functions and log a warning before calling the implementation. | ||
* This is mostly to 'lint' writing tests, and improves detecting which assertion fails | ||
* instead of it being 'logged' on the 'parent'. | ||
*/ | ||
function mutateRunnerEnablingWarnings(runner) { | ||
const methods = [ | ||
"ok", | ||
"notOk", | ||
"equal", | ||
"notEqual", | ||
"deepEqual", | ||
"fail", | ||
"pass", | ||
"test", | ||
]; | ||
for (const method of methods) { | ||
const implementation = runner[method]; | ||
runner[method] = (...args) => { | ||
runner.log.error( | ||
`warning: called 't.${method}' on parent 't'. Accept 't' as argument in the callback of 't.test(msg, callback)'.`, | ||
); | ||
implementation(...args); | ||
}; | ||
} | ||
} | ||
/** | ||
* @param {TestState} state | ||
@@ -103,2 +134,3 @@ * @param {*} value | ||
actual: passed, | ||
expected: true, | ||
}, | ||
@@ -122,2 +154,3 @@ message, | ||
actual: passed, | ||
expected: false, | ||
}, | ||
@@ -124,0 +157,0 @@ message, |
@@ -17,3 +17,3 @@ import { mainFn } from "@lbu/stdlib"; | ||
const mc = await newMigrateContext(sql); | ||
logger.info(getMigrationsToBeApplied(mc) || "No migrations to be applied"); | ||
logger.info(getMigrationsToBeApplied(mc)); | ||
@@ -20,0 +20,0 @@ await runMigrations(mc); |
@@ -6,3 +6,2 @@ import { newLogger } from "@lbu/insight"; | ||
FileCache, | ||
newFileStoreContext, | ||
newMinioClient, | ||
@@ -15,4 +14,4 @@ newPostgresConnection, | ||
app, | ||
appBucket, | ||
ensureBuckets, | ||
fileStore, | ||
minio, | ||
@@ -24,3 +23,2 @@ sessionStore, | ||
setFileCache, | ||
setFileStore, | ||
setMinio, | ||
@@ -50,5 +48,4 @@ setServiceLogger, | ||
setMinio(newMinioClient({})); | ||
setFileStore(newFileStoreContext(sql, minio, process.env.APP_NAME)); | ||
setSessionStore(newSessionStore(sql, {})); | ||
setFileCache(new FileCache(fileStore)); | ||
setSessionStore(newSessionStore(sql)); | ||
setFileCache(new FileCache(sql, minio, appBucket)); | ||
@@ -55,0 +52,0 @@ setApp(createApp()); |
@@ -16,6 +16,2 @@ import { FileCache } from "@lbu/store"; | ||
/** | ||
* @type {FileStoreContext} | ||
*/ | ||
export let fileStore = undefined; | ||
/** | ||
* @type {SessionStore} | ||
@@ -64,11 +60,2 @@ */ | ||
/** | ||
* @param newFileStore | ||
*/ | ||
export function setFileStore(newFileStore) { | ||
serviceLogger.info("setting fileStore"); | ||
fileStore = newFileStore; | ||
return fileStore; | ||
} | ||
/** | ||
* @param newSessionStore | ||
@@ -75,0 +62,0 @@ */ |
@@ -8,3 +8,2 @@ import { newLogger } from "@lbu/insight"; | ||
FileCache, | ||
newFileStoreContext, | ||
newMinioClient, | ||
@@ -49,9 +48,4 @@ newSessionStore, | ||
setMinio(newMinioClient({})); | ||
setFileStore(newFileStoreContext(sql, minio, appBucket)); | ||
setSessionStore( | ||
newSessionStore(sql, { | ||
disableInterval: true, | ||
}), | ||
); | ||
setFileCache(new FileCache(fileStore)); | ||
setSessionStore(newSessionStore(sql)); | ||
setFileCache(new FileCache(sql, minio, appBucket)); | ||
@@ -58,0 +52,0 @@ setApp(createApp()); |
74969
2471
16
+ Added@lbu/insight@0.0.79(transitive)
+ Added@lbu/stdlib@0.0.79(transitive)
- Removed@lbu/insight@0.0.78(transitive)
- Removed@lbu/stdlib@0.0.78(transitive)
Updated@lbu/insight@0.0.79
Updated@lbu/stdlib@0.0.79