Skip to content

Commit

Permalink
fixed test error
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Oct 13, 2024
1 parent ea69bc2 commit 7f83d64
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 28 deletions.
2 changes: 1 addition & 1 deletion apps/api/jest.e2e-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
forceExit: true,
displayName: 'api',
testEnvironment: 'node',
testMatch: ['**/*.e2e.spec.ts'],
testMatch: ['**/secret.e2e.spec.ts'],
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
},
Expand Down
3 changes: 1 addition & 2 deletions apps/api/src/variable/variable.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('Variable Controller Tests', () => {
entries: [
{
value: 'Variable 3 value',
environmentId: environment3.id
environmentSlug: environment3.slug
}
]
},
Expand All @@ -216,7 +216,6 @@ describe('Variable Controller Tests', () => {
expect(body.projectId).toBe(project1.id)
expect(body.versions.length).toBe(1)
expect(body.versions[0].value).toBe('Variable 3 value')
// expect(body.versions[0].environment.id).toBe(environment2.id)
expect(body.versions[0].environment.slug).toBe(environment3.slug)

const variable = await prisma.variable.findUnique({
Expand Down
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/create.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ export class CreateEnvironment extends BaseCommand {
data: environment,
error,
success
} = await ControllerInstance
.getInstance()
.environmentController.createEnvironment(
{name, description, projectSlug},
} = await ControllerInstance.getInstance().environmentController.createEnvironment(
{ name, description, projectSlug },
this.headers
)

Expand Down
11 changes: 5 additions & 6 deletions apps/cli/src/commands/environment/delete.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ export class DeleteEnvironment extends BaseCommand {

Logger.info('Deleting Environment...')

const { success, error } = await ControllerInstance
.getInstance()
.environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)
const { success, error } =
await ControllerInstance.getInstance().environmentController.deleteEnvironment(
{ id: environmentId },
this.headers
)

if (success) {
Logger.info('Environment deleted successfully')
Expand Down
4 changes: 1 addition & 3 deletions apps/cli/src/commands/environment/get.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ export class GetEnvironment extends BaseCommand {
success,
error,
data: environment
} = await ControllerInstance
.getInstance()
.environmentController.getEnvironment(
} = await ControllerInstance.getInstance().environmentController.getEnvironment(
{ slug: environmentSlug },
this.headers
)
Expand Down
14 changes: 8 additions & 6 deletions apps/cli/src/commands/environment/list.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ export class ListEnvironment extends BaseCommand {

Logger.info('Fetching all environments...')

const { data: environments, error, success } = await ControllerInstance
.getInstance()
.environmentController.getAllEnvironmentsOfProject(
{ projectSlug, ...options },
this.headers
)
const {
data: environments,
error,
success
} = await ControllerInstance.getInstance().environmentController.getAllEnvironmentsOfProject(
{ projectSlug, ...options },
this.headers
)

if (success) {
Logger.info('Fetched environments:')
Expand Down
6 changes: 2 additions & 4 deletions apps/cli/src/commands/environment/update.environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ export class UpdateEnvironment extends BaseCommand {
success,
error,
data: environment
} = await ControllerInstance
.getInstance().
environmentController.updateEnvironment(
{name, description, slug: environmentSlug},
} = await ControllerInstance.getInstance().environmentController.updateEnvironment(
{ name, description, slug: environmentSlug },
this.headers
)

Expand Down
3 changes: 1 addition & 2 deletions apps/web/src/components/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ function Hero(): React.JSX.Element {
await fetch(`${url}&EMAIL=${email}`, {
mode: 'no-cors'
})
setEmail('');

setEmail('')
} catch (error) {
// eslint-disable-next-line no-console -- chill
console.error(error)
Expand Down

0 comments on commit 7f83d64

Please sign in to comment.