-
Notifications
You must be signed in to change notification settings - Fork 74
chore(cli): lint test files #441
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ const fakeChokidarWatcherOn = { | |
| }, | ||
|
|
||
| get fileEventCallback(): ( | ||
| event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', | ||
| path: string, | ||
| event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', | ||
| path: string, | ||
| ) => Promise<void> { | ||
| expect(mockChokidarWatcherOn.mock.calls.length).toBeGreaterThanOrEqual(2); | ||
| const secondCall = mockChokidarWatcherOn.mock.calls[1]; | ||
|
|
@@ -60,46 +60,49 @@ jest.setTimeout(30_000); | |
| import 'aws-sdk-client-mock'; | ||
| import * as os from 'os'; | ||
| import * as path from 'path'; | ||
| import * as cdkAssets from 'cdk-assets'; | ||
| import * as cxschema from '@aws-cdk/cloud-assembly-schema'; | ||
| import { Manifest } from '@aws-cdk/cloud-assembly-schema'; | ||
| import * as cxapi from '@aws-cdk/cx-api'; | ||
| import type { DestroyStackResult } from '@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack'; | ||
| import { DescribeStacksCommand, GetTemplateCommand, StackStatus } from '@aws-sdk/client-cloudformation'; | ||
| import { GetParameterCommand } from '@aws-sdk/client-ssm'; | ||
| import * as cdkAssets from 'cdk-assets'; | ||
| import * as fs from 'fs-extra'; | ||
| import * as promptly from 'promptly'; | ||
| import { SdkProvider } from '../../lib/api'; | ||
| import type { Template } from '../../../@aws-cdk/toolkit-lib/lib/api'; | ||
| import { asIoHelper } from '../../../@aws-cdk/toolkit-lib/lib/api/io/private'; | ||
| import type { SdkProvider } from '../../lib/api'; | ||
| import { Bootstrapper, type BootstrapSource } from '../../lib/api/bootstrap'; | ||
| import { | ||
| import type { | ||
| DeployStackResult, | ||
| SuccessfulDeployStackResult, | ||
| Deployments, | ||
| DeployStackOptions, | ||
| DestroyStackOptions, | ||
| RollbackStackOptions, | ||
| RollbackStackResult, | ||
| } from '../../lib/api/deployments'; | ||
| import { | ||
| Deployments, | ||
| } from '../../lib/api/deployments'; | ||
| import { HotswapMode } from '../../lib/api/hotswap'; | ||
| import { Mode } from '../../lib/api/plugin'; | ||
| import { Tag } from '../../lib/api/tags'; | ||
| import type { Tag } from '../../lib/api/tags'; | ||
| import { CdkToolkit, markTesting } from '../../lib/cli/cdk-toolkit'; | ||
| import { CliIoHost } from '../../lib/cli/io-host'; | ||
| import { Configuration } from '../../lib/cli/user-configuration'; | ||
| import { StackActivityProgress } from '../../lib/commands/deploy'; | ||
| import { RequireApproval } from '../../lib/commands/diff'; | ||
| import { CliIoHost } from '../../lib/cli/io-host'; | ||
| import { flatten } from '../../lib/util'; | ||
| import { MockCloudExecutable, TestStackArtifact } from '../_helpers/assembly'; | ||
| import { instanceMockFrom } from '../_helpers/as-mock'; | ||
| import type { TestStackArtifact } from '../_helpers/assembly'; | ||
| import { MockCloudExecutable } from '../_helpers/assembly'; | ||
| import { | ||
| mockCloudFormationClient, | ||
| MockSdk, | ||
| MockSdkProvider, | ||
| mockSSMClient, | ||
| restoreSdkMocksToDefault, | ||
| } from '../_helpers/mock-sdk'; | ||
| import { asIoHelper } from '../../../@aws-cdk/toolkit-lib/lib/api/io/private'; | ||
| import { StackActivityProgress } from '../../lib/commands/deploy'; | ||
| import { Template } from '../../../@aws-cdk/toolkit-lib/lib/api'; | ||
| import { DestroyStackResult } from '@aws-cdk/toolkit-lib/lib/api/deployments/deploy-stack'; | ||
|
|
||
| markTesting(); | ||
|
|
||
|
|
@@ -154,7 +157,6 @@ function defaultToolkitSetup() { | |
|
|
||
| const mockSdk = new MockSdk(); | ||
|
|
||
|
|
||
| describe('bootstrap', () => { | ||
| test('accepts qualifier from context', async () => { | ||
| // GIVEN | ||
|
|
@@ -276,6 +278,7 @@ describe('deploy', () => { | |
| deployments: new FakeCloudFormation({}), | ||
| }); | ||
| stderrMock.mockImplementation((...x) => { | ||
| // eslint-disable-next-line no-console | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allow in this case |
||
| console.error(...x); | ||
| }); | ||
|
|
||
|
|
@@ -1034,8 +1037,8 @@ describe('deploy', () => { | |
|
|
||
| await toolkit.deploy({ | ||
| progress: StackActivityProgress.EVENTS, | ||
| selector: { patterns: ["**"] }, | ||
| hotswap: HotswapMode.FALL_BACK | ||
| selector: { patterns: ['**'] }, | ||
| hotswap: HotswapMode.FALL_BACK, | ||
| }); | ||
|
|
||
| // now expect it to be updated | ||
|
|
@@ -1556,7 +1559,6 @@ describe('migrate', () => { | |
| }); | ||
|
|
||
| describe('rollback', () => { | ||
|
|
||
| test('rollback uses deployment role', async () => { | ||
| cloudExecutable = new MockCloudExecutable({ | ||
| stacks: [MockStack.MOCK_STACK_C], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| import { PassThrough } from 'stream'; | ||
| import * as chalk from 'chalk'; | ||
| import { CliIoHost, IoMessage, IoMessageLevel, IoRequest } from '../../../lib/cli/io-host'; | ||
| import { RequireApproval } from '@aws-cdk/cloud-assembly-schema'; | ||
| import * as chalk from 'chalk'; | ||
| import type { IoMessage, IoMessageLevel, IoRequest } from '../../../lib/cli/io-host'; | ||
| import { CliIoHost } from '../../../lib/cli/io-host'; | ||
|
|
||
| let passThrough: PassThrough; | ||
|
|
||
|
|
@@ -429,7 +430,7 @@ describe('CliIoHost', () => { | |
| }); | ||
|
|
||
| test('require approval by default - respond no', async () => { | ||
| expect(() => requestResponse('n', plainMessage({ | ||
| await expect(() => requestResponse('n', plainMessage({ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was missing before, all promises must be awaited |
||
| time: new Date(), | ||
| level: 'info', | ||
| action: 'synth', | ||
|
|
||
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.
These were missing dev deps that eslint discovered.