refactor: test

This commit is contained in:
Mo
2023-08-02 13:27:13 -05:00
parent 9961f83246
commit 25596e70a8
2 changed files with 10 additions and 9 deletions

View File

@@ -27,6 +27,7 @@
"build:services": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/services run build", "build:services": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/services run build",
"build:api": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/api run build", "build:api": "yarn workspaces foreach -pt --topological-dev --verbose -R --from @standardnotes/api run build",
"e2e": "lerna run start:test-server --scope=@standardnotes/snjs", "e2e": "lerna run start:test-server --scope=@standardnotes/snjs",
"e2e:test": "yarn dlx mocha-headless-chrome --timeout 1800000 -f http://localhost:9001/mocha/test.html",
"reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install", "reset": "find . -type dir -name node_modules | xargs rm -rf && rm -rf yarn.lock && yarn install",
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"", "release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
"publish:prod": "lerna publish from-git --yes --no-verify-access --loglevel verbose", "publish:prod": "lerna publish from-git --yes --no-verify-access --loglevel verbose",

View File

@@ -693,21 +693,21 @@ export class AppContext {
payAmount: 59.0, payAmount: 59.0,
}) })
await Utils.sleep(2) await Utils.sleep(2, 'Waiting for premium features to be activated')
} catch (error) { } catch (error) {
console.warn( console.warn(
`Mock events service not available. You are probably running a test suite for home server: ${error.message}`, `Mock events service not available. You are probably running a test suite for home server: ${error.message}`,
) )
}
try { try {
await HomeServer.activatePremiumFeatures(this.email, options.subscriptionPlanName, options.expiresAt) await HomeServer.activatePremiumFeatures(this.email, options.subscriptionPlanName, options.expiresAt)
await Utils.sleep(1, 'Waiting for premium features to be activated') await Utils.sleep(1, 'Waiting for premium features to be activated')
} catch (error) { } catch (error) {
console.warn( console.warn(
`Home server not available. You are probably running a test suite for self hosted setup: ${error.message}`, `Home server not available. You are probably running a test suite for self hosted setup: ${error.message}`,
) )
}
} }
} }
} }