-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
increase coverage for setup app #12
Conversation
a12b9cf
to
b7c1b55
Compare
b7c1b55
to
202a491
Compare
72830ef
to
1b7e5af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple suggestions
src/lib/api.test.ts
Outdated
import jwt from 'jsonwebtoken' | ||
|
||
beforeEach(() => { | ||
process.env.MANAGEMENT_APP_PRIVATE_KEY = 'mockprivatekeyvalue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these be set in the jest.env section in package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 @philschatz i think you left a similar comment on my test about using the jest setupFile
feature, but i couldn't find a similar feature in vitest which we're using (i think referencing jest makes things a little more confusing since its not totally 1-1 with feature names or parity), i ended up taking this same approach for setting up/tearing down env variables here
i figure whatever we do in one place we should do in the other too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks buddies 🙏
src/lib/utils.ts
Outdated
} | ||
|
||
// returns given value with type certainty, or silently exchanges value if null or undefined | ||
export const ensureValueWithExchange = <T>(value: T, exchange: NonNullable<T>): NonNullable<T> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would Or work?
src/lib/utils.ts
Outdated
if (runId !== undefined && !managementAppRunIds.includes(runId) && item.ResourceARN !== undefined) { | ||
orphanTaskDefinitions.push(item.ResourceARN) | ||
} | ||
}) | ||
|
||
return orphanTaskDefinitions | ||
} | ||
|
||
// returns given value with type certainty, or errors if value is null or undefined | ||
export const ensureValueWithError = <T>(value: T, message?: string): NonNullable<T> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const ensureValueWithError = <T>(value: T, message?: string): NonNullable<T> => { | |
export const ensureValueWithError = <T>(value: T | undefined | null, message?: string): T => { |
Maybe easier to read... fewer negatives?
const baseTaskDefinition = process.env.BASE_TASK_DEFINITION_FAMILY || '' | ||
const subnets = process.env.VPC_SUBNETS || '' | ||
const securityGroup = process.env.SECURITY_GROUP || '' | ||
const cluster = ensureValueWithExchange(process.env.ECS_CLUSTER, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch most (all?) ensureValueWithExchange
to be ensureValueWithError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will address in SHRMP-51 (made a comment on the issue)
36c2e1f
to
52efae5
Compare
@@ -7,11 +7,10 @@ | |||
"dev": "next dev", | |||
"build": "next build", | |||
"start": "next start", | |||
"lint": "next lint && prettier --check .", | |||
"lint:fix": "next lint --fix && prettier --write .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come no more next lint? just curious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next lint
gives an error when those frontend files are removed (pages
) and (apps
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so jealous you guys get to remove all your frontend files 😆
No description provided.