1
0
Fork 0

log settings on sample failure if log===true

This commit is contained in:
Enoch Riese 2022-11-16 10:58:43 -06:00
parent 29604759f2
commit 62fff1be51
3 changed files with 12 additions and 8 deletions

View file

@ -34,7 +34,7 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: npx lerna bootstrap --use-workspaces
run: npx lerna bootstrap
env:
CI: true
- name: Build all

View file

@ -16,8 +16,8 @@
"tips": "node scripts/help.mjs",
"lab": "cd sites/lab && yarn start",
"lab-debug": "cd sites/lab && yarn start-debug",
"kickstart": "npx lerna bootstrap --use-workspaces && yarn buildall && yarn prepare && yarn tips",
"kickstart:windows": "npx lerna bootstrap --use-workspaces && yarn wbuildall && yarn prepare && yarn tips",
"kickstart": "npx lerna bootstrap && yarn buildall && yarn prepare && yarn tips",
"kickstart:windows": "npx lerna bootstrap && yarn wbuildall && yarn prepare && yarn tips",
"cleanall": "lerna run clean",
"test": "lerna run test",
"prettier": "npx prettier --write 'config/*' 'config/**/*' 'packages/**/src/*.mjs' 'packages/i18n/src/locales/**/*.*' 'packages/**/tests/*.mjs'",

View file

@ -26,23 +26,27 @@ export const testPatternSampling = (Pattern, log = false) => {
pattern.sample().render()
if (log === 'always') {
console.log(pattern.store.logs)
console.log(pattern.setStores[0].logs)
console.log(pattern.setStores[pattern.activeSet].logs)
}
if (pattern.store.logs.error.length < 1 && pattern.setStores[0].logs.error.length < 1) {
if (
pattern.store.logs.error.length < 1 &&
pattern.setStores[pattern.activeSet].logs.error.length < 1
) {
return true
}
if (log && log !== 'always') {
console.log(pattern.settings[pattern.activeSet])
console.log(pattern.store.logs)
console.log(pattern.setStores[0].logs)
console.log(pattern.setStores[pattern.activeSet].logs)
}
return false
} catch (err) {
if (log && log !== 'always') {
console.log(pattern.settings[0])
console.log(pattern.settings[pattern.activeSet])
console.log(err)
console.log(pattern.store.logs)
console.log(pattern.setStores[0].logs)
console.log(pattern.setStores[pattern.activeSet].logs)
}
return false