Skip to content

Commit

Permalink
style: format source
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Aug 12, 2024
1 parent c2ff58d commit afe23f4
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions cdk/App.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App } from 'aws-cdk-lib'
import { HTTPAPIMockStack } from './Stack.js'
import type { PackedLambda } from '@bifravst/aws-cdk-lambda-helpers'
import type { PackedLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
import { App } from 'aws-cdk-lib'
import { HTTPAPIMockStack } from './Stack.js'

export class HTTPAPIMockApp extends App {
public constructor(
Expand Down
6 changes: 3 additions & 3 deletions cdk/Stack.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { App } from 'aws-cdk-lib'
import { CfnOutput, aws_lambda as Lambda, Stack } from 'aws-cdk-lib'
import type { PackedLambda } from '@bifravst/aws-cdk-lambda-helpers'
import type { PackedLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
import { LambdaSource } from '@bifravst/aws-cdk-lambda-helpers/cdk'
import type { PackedLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
import type { App } from 'aws-cdk-lib'
import { CfnOutput, aws_lambda as Lambda, Stack } from 'aws-cdk-lib'
import { HttpApiMock } from './resources/HttpApiMock.js'

/**
Expand Down
8 changes: 4 additions & 4 deletions cdk/http-api-mock.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { packLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
import { packLambdaFromPath } from '@bifravst/aws-cdk-lambda-helpers'
import { HTTPAPIMockApp } from './App.js'
import { packLayer } from '@bifravst/aws-cdk-lambda-helpers/layer'
import { fromEnv } from '@bifravst/from-env'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import fs from 'node:fs/promises'
import os from 'node:os'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import type pJSON from '../package.json'
import { HTTPAPIMockApp } from './App.js'

const { stackName } = fromEnv({ stackName: 'HTTP_API_MOCK_STACK_NAME' })(
process.env,
Expand Down
10 changes: 5 additions & 5 deletions cdk/resources/HttpApiMock.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import type { PackedLambda } from '@bifravst/aws-cdk-lambda-helpers'
import {
LambdaLogGroup,
LambdaSource,
} from '@bifravst/aws-cdk-lambda-helpers/cdk'
import {
aws_apigateway as ApiGateway,
Duration,
Expand All @@ -9,11 +14,6 @@ import {
Resource,
} from 'aws-cdk-lib'
import type { Construct } from 'constructs'
import {
LambdaSource,
LambdaLogGroup,
} from '@bifravst/aws-cdk-lambda-helpers/cdk'
import type { PackedLambda } from '@bifravst/aws-cdk-lambda-helpers'

export class HttpApiMock extends Resource {
public readonly api: ApiGateway.RestApi
Expand Down
2 changes: 1 addition & 1 deletion cdk/resources/checkMatchingQueryParams.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import { checkMatchingQueryParams } from './checkMatchingQueryParams.js'

void describe('checkMatchingQueryParams', () => {
Expand Down
2 changes: 1 addition & 1 deletion cdk/resources/http-api-mock-lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import type {
Context,
} from 'aws-lambda'
import { URLSearchParams } from 'url'
import { sortQueryString } from '../../src/sortQueryString.js'
import { checkMatchingQueryParams } from './checkMatchingQueryParams.js'
import { splitMockResponse } from './splitMockResponse.js'
import { sortQueryString } from '../../src/sortQueryString.js'

const db = new DynamoDBClient({})

Expand Down
4 changes: 2 additions & 2 deletions cdk/resources/splitMockResponse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { splitMockResponse } from './splitMockResponse.js'
import { describe, it } from 'node:test'
import assert from 'node:assert'
import { describe, it } from 'node:test'
import { splitMockResponse } from './splitMockResponse.js'
void describe('split mock response', () => {
void it('should parse headers and body', () =>
assert.deepEqual(
Expand Down
8 changes: 4 additions & 4 deletions e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { listRequests } from './src/requests.js'
import { registerResponse } from './src/responses.js'
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'
import assert from 'node:assert/strict'
import { readFile } from 'node:fs/promises'
import path from 'node:path'
import { describe, it } from 'node:test'
import { listRequests } from './src/requests.js'
import { registerResponse } from './src/responses.js'

const { responsesTableName, apiURL, requestsTableName } = JSON.parse(

Check warning on line 9 in e2e.spec.ts

View workflow job for this annotation

GitHub Actions / tests

Unsafe assignment of an `any` value
await readFile(path.join(process.cwd(), 'http-api-mock.json'), 'utf-8'),
Expand Down
10 changes: 5 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { randomString } from './randomString.js'
import run from '@bifravst/run'
import { CloudFormationClient } from '@aws-sdk/client-cloudformation'
import { GetCallerIdentityCommand, STSClient } from '@aws-sdk/client-sts'
import chalk from 'chalk'
import { stackOutput } from '@bifravst/cloudformation-helpers'
import type { StackOutputs } from '../cdk/Stack.js'
import { CloudFormationClient } from '@aws-sdk/client-cloudformation'
import run from '@bifravst/run'
import chalk from 'chalk'
import path, { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import type { StackOutputs } from '../cdk/Stack.js'
import { randomString } from './randomString.js'

const die = (err: Error): void => {
console.error('')
Expand Down
6 changes: 3 additions & 3 deletions src/mock.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, mock as testMock } from 'node:test'
import assert from 'node:assert/strict'
import { mock } from './mock.js'
import type { AttributeValue, DynamoDBClient } from '@aws-sdk/client-dynamodb'
import { unmarshall } from '@aws-sdk/util-dynamodb'
import assert from 'node:assert/strict'
import { describe, it, mock as testMock } from 'node:test'
import { mock } from './mock.js'

void describe('mock()', () => {
void it('should register a response', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/parseMockRequest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import { parseMockRequest } from './parseMockRequest.js'

void describe('parseMockRequest()', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/parseMockResponse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it } from 'node:test'
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import { parseMockResponse } from './parseMockResponse.js'

void describe('parseMockResponse()', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/sortQueryString.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert'
import { describe, test as it } from 'node:test'
import { sortQuery, sortQueryString } from './sortQueryString.js'
import { URLSearchParams } from 'node:url'
import { sortQuery, sortQueryString } from './sortQueryString.js'

void describe('sortQueryString', () => {
void it('should sort the query part of a mock URL', () =>
Expand Down

0 comments on commit afe23f4

Please sign in to comment.