Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandra-c committed Jul 29, 2024
1 parent 9339aec commit e277637
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions generators/app/templates/infrastructure/src/servers/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ const startApolloServer = async (httpServer<% if(addSubscriptions) {%>, subscrip
const app = new Koa();
app.use(loggingMiddleware)
.use(errorHandlingMiddleware())
.use(bodyParser());
.use(correlationMiddleware());
.use(cors({ credentials: true }));
.use(bodyParser())
.use(correlationMiddleware())
.use(cors({ credentials: true }))
.use(ignore(jwtTokenValidation, jwtTokenUserIdentification<% if(withMultiTenancy) {%>, tenantIdentification()<%}%>).if(ctx => publicRoute(ctx)))
<%_ if(addTracing){ _%>
tracingEnabled && app.use(tracingMiddleware());
tracingEnabled && app.use(tracingMiddleware())
<%_}_%>
<%_ if(dataLayer == "knex") {_%>
.use(contextDbInstance());
.use(contextDbInstance())
<%_}_%>
.use(
koaMiddleware(apolloServer,{
Expand Down
6 changes: 3 additions & 3 deletions generators/generator-transforms.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const through = require('through2')
const prettier = require('prettier')
const { resolveConfig, format } = require('prettier')

const defaultPrettierOptions = {
printWidth: 125,
Expand All @@ -13,15 +13,15 @@ const defaultPrettierOptions = {
const prettierTransform = function (defaultOptions) {
const transform = (file, encoding, callback) => {
/* Resolve from the projects config */
prettier.resolveConfig(file.relative).then(options => {
resolveConfig(file.relative).then(options => {
const str = file.contents.toString('utf8')
if (!options || Object.keys(options).length === 0) {
options = defaultOptions
}

// For better errors
options.filepath = file.relative
const data = prettier.format(str, options)
const data = format(str, options)
file.contents = Buffer.from(data)
callback(null, file)
})
Expand Down

0 comments on commit e277637

Please sign in to comment.