Merge pull request #2699 from overleaf/jpa-test-perf

[perf] enable view caching for acceptance tests

GitOrigin-RevId: 696958a617392d20b594141aa316b5a80755ff38
This commit is contained in:
nate stemen 2020-03-30 14:12:56 -04:00 committed by Copybot
parent 1af99ac8b2
commit 3b1a5c458e

View file

@ -234,6 +234,10 @@ if (enableWebRouter || notDefined(enableWebRouter)) {
logger.info('precompiling views for web in production environment') logger.info('precompiling views for web in production environment')
Views.precompileViews(app) Views.precompileViews(app)
} }
if (app.get('env') === 'test') {
logger.info('enabling view cache for acceptance tests')
app.enable('view cache')
}
app.use(publicApiRouter) // public API goes with web router for public access app.use(publicApiRouter) // public API goes with web router for public access
app.use(Validation.errorMiddleware) app.use(Validation.errorMiddleware)