Skip to content

Commit 470d1b6

Browse files
committed
test(types): fix types from bumped ts version
1 parent a8a6542 commit 470d1b6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/types/util.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// https://github.com/Microsoft/TypeScript/issues/25987#issuecomment-408339599
2-
export type KnownKeys<T> = {
3-
[K in keyof T]: string extends K ? never : number extends K ? never : K;
4-
} extends { [_ in keyof T]: infer U }
5-
? U
6-
: never;
2+
export type KnownKeys<T> = keyof {
3+
[K in keyof T as string extends K
4+
? never
5+
: number extends K
6+
? never
7+
: K]: never;
8+
};

test/get-ca-config.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('get-ca-config', () => {
4848
try {
4949
await getCodeArtifactConfig(config, context);
5050
} catch (errors) {
51-
const [error, ...otherErrors] = errors;
51+
const [error, ...otherErrors] = errors as any[];
5252
expect(error?.code).toEqual<keyof ErrorDefinitions>('ENOAUTHTOKEN');
5353
expect(error?.name).toEqual('SemanticReleaseError');
5454
expect(otherErrors).toHaveLength(0);
@@ -62,7 +62,7 @@ describe('get-ca-config', () => {
6262
try {
6363
await getCodeArtifactConfig(config, context);
6464
} catch (errors) {
65-
const [error, ...otherErrors] = errors;
65+
const [error, ...otherErrors] = errors as any[];
6666
expect(error?.code).toEqual<keyof ErrorDefinitions>('ENOREPOENDPOINT');
6767
expect(error?.name).toEqual('SemanticReleaseError');
6868
expect(otherErrors).toHaveLength(0);
@@ -80,7 +80,7 @@ describe('get-ca-config', () => {
8080
try {
8181
await getCodeArtifactConfig(config, context);
8282
} catch (errors) {
83-
const [error, ...otherErrors] = errors;
83+
const [error, ...otherErrors] = errors as any[];
8484
expect(error?.code).toEqual<keyof ErrorDefinitions>('EAWSSDK');
8585
expect(error?.name).toEqual('SemanticReleaseError');
8686
expect(error?.details).toMatch('TestAWSError');
@@ -97,7 +97,7 @@ describe('get-ca-config', () => {
9797
try {
9898
await getCodeArtifactConfig(config, context);
9999
} catch (errors) {
100-
const [error, ...otherErrors] = errors;
100+
const [error, ...otherErrors] = errors as any[];
101101
expect(error?.code).toEqual<keyof ErrorDefinitions>('EAWSSDK');
102102
expect(error?.name).toEqual('SemanticReleaseError');
103103
expect(error?.details).toMatch('UnknownException');

0 commit comments

Comments
 (0)