Skip to content

Commit 89c9616

Browse files
committed
fix some vue test warnings
1 parent 494291d commit 89c9616

File tree

8 files changed

+18
-16
lines changed

8 files changed

+18
-16
lines changed

app/registries/Registry.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test('normalizeImage should return same image when not overridden', async () =>
8484
});
8585

8686
test('authenticate should return same request options when not overridden', async () => {
87-
expect(registry.authenticate({}, { x: 'x' })).resolves.toStrictEqual({
87+
await expect(registry.authenticate({}, { x: 'x' })).resolves.toStrictEqual({
8888
x: 'x',
8989
});
9090
});
@@ -153,7 +153,7 @@ describe('getImageManifestDigest', () => {
153153
}
154154
throw new Error('Boom!');
155155
};
156-
expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
156+
await expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
157157
version: 2,
158158
digest: '123456789',
159159
});
@@ -175,7 +175,7 @@ describe('getImageManifestDigest', () => {
175175
}
176176
throw new Error('Boom!');
177177
};
178-
expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
178+
await expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
179179
version: 1,
180180
digest: 'digest_x',
181181
});
@@ -227,7 +227,7 @@ describe('getImageManifestDigest', () => {
227227
}
228228
throw new Error('Boom!');
229229
};
230-
expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
230+
await expect(registryMocked.getImageManifestDigest(imageInput())).resolves.toStrictEqual({
231231
version: 1,
232232
digest: 'xxxxxxxxxx',
233233
created: undefined,

app/registries/providers/acr/Acr.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ test('normalizeImage should return the proper registry v2 endpoint', async () =>
6969
});
7070

7171
test('authenticate should add basic auth', async () => {
72-
expect(acr.authenticate(undefined, { headers: {} })).resolves.toEqual({
72+
await expect(acr.authenticate(undefined, { headers: {} })).resolves.toEqual({
7373
headers: {
7474
Authorization: 'Basic Y2xpZW50aWQ6Y2xpZW50c2VjcmV0',
7575
},

app/registries/providers/docr/Docr.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ test('authenticate should add basic auth from token alias', async () => {
9595
password: TEST_TOKEN,
9696
};
9797

98-
expect(docr.authenticate(undefined, { headers: {} })).resolves.toEqual({
98+
await expect(docr.authenticate(undefined, { headers: {} })).resolves.toEqual({
9999
headers: {
100100
Authorization: 'Basic ZG9jdGw6ZG9wX3YxX2FiY2RlZg==',
101101
},

app/registries/providers/gcr/Gcr.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ test('normalizeImage should return the proper registry v2 endpoint', async () =>
100100
});
101101

102102
test('authenticate should call gcr auth endpoint', async () => {
103-
expect(gcr.authenticate({}, { headers: {} })).resolves.toEqual({
103+
await expect(gcr.authenticate({}, { headers: {} })).resolves.toEqual({
104104
headers: {
105105
Authorization: 'Bearer xxxxx',
106106
},

app/registries/providers/gitlab/Gitlab.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test('authenticate should perform authenticate request', async () => {
8383
token: 'token',
8484
},
8585
}));
86-
expect(
86+
await expect(
8787
gitlab.authenticate(
8888
{},
8989
{

app/registries/providers/quay/Quay.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ test('getAuthPull should return credentials when auth configuration', async () =
130130
});
131131

132132
test('authenticate should populate header with base64 bearer', async () => {
133-
expect(quay.authenticate({}, { headers: {} })).resolves.toEqual({
133+
await expect(quay.authenticate({}, { headers: {} })).resolves.toEqual({
134134
headers: {
135135
Authorization: `Bearer ${TEST_TOKEN}`,
136136
},
@@ -140,7 +140,7 @@ test('authenticate should populate header with base64 bearer', async () => {
140140
test('authenticate should not populate header with base64 bearer when anonymous', async () => {
141141
const quayInstance = new Quay();
142142
quayInstance.configuration = {};
143-
expect(quayInstance.authenticate({}, { headers: {} })).resolves.toEqual({
143+
await expect(quayInstance.authenticate({}, { headers: {} })).resolves.toEqual({
144144
headers: {},
145145
});
146146
});

app/registry/Component.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ test('register should not call init when validateConfiguration fails', async ()
4646
throw new Error('validation failed');
4747
};
4848
const spyInit = vi.spyOn(component, 'init');
49-
expect(component.register('type', 'name', { x: 'x' })).rejects.toThrowError('validation failed');
49+
await expect(component.register('type', 'name', { x: 'x' })).rejects.toThrowError(
50+
'validation failed',
51+
);
5052
expect(spyInit).toHaveBeenCalledTimes(0);
5153
});
5254

@@ -55,7 +57,7 @@ test('register should throw when init fails', async () => {
5557
component.init = () => {
5658
throw new Error('init failed');
5759
};
58-
expect(component.register('type', 'name', { x: 'x' })).rejects.toThrowError('init failed');
60+
await expect(component.register('type', 'name', { x: 'x' })).rejects.toThrowError('init failed');
5961
});
6062

6163
test('getId should include agent prefix when agent is set', async () => {

app/registry/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ test('deregisterAll should throw an error when any component fails to deregister
649649
registry.getState().trigger = {
650650
trigger1: component,
651651
};
652-
expect(registry.testable_deregisterAll()).rejects.toThrowError(
652+
await expect(registry.testable_deregisterAll()).rejects.toThrowError(
653653
'Error when deregistering component .',
654654
);
655655
});
@@ -662,7 +662,7 @@ test('deregisterRegistries should throw when errors occurred', async () => {
662662
registry.getState().registry = {
663663
registry1: component,
664664
};
665-
expect(registry.testable_deregisterRegistries()).rejects.toThrowError(
665+
await expect(registry.testable_deregisterRegistries()).rejects.toThrowError(
666666
'Error when deregistering component .',
667667
);
668668
});
@@ -675,7 +675,7 @@ test('deregisterTriggers should throw when errors occurred', async () => {
675675
registry.getState().trigger = {
676676
trigger1: component,
677677
};
678-
expect(registry.testable_deregisterTriggers()).rejects.toThrowError(
678+
await expect(registry.testable_deregisterTriggers()).rejects.toThrowError(
679679
'Error when deregistering component .',
680680
);
681681
});
@@ -688,7 +688,7 @@ test('deregisterWatchers should throw when errors occurred', async () => {
688688
registry.getState().watcher = {
689689
watcher1: component,
690690
};
691-
expect(registry.testable_deregisterWatchers()).rejects.toThrowError(
691+
await expect(registry.testable_deregisterWatchers()).rejects.toThrowError(
692692
'Error when deregistering component .',
693693
);
694694
});

0 commit comments

Comments
 (0)