Skip to content

Commit 85e1d2c

Browse files
committed
Address comments
1 parent aa658d2 commit 85e1d2c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/cache_test.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { deepStrictEqual, deepEqual, fail, notStrictEqual, strictEqual, throws } from 'node:assert';
1+
import { deepStrictEqual, notStrictEqual, strictEqual, throws } from 'node:assert';
22
import mock from 'ts-mockito';
33

44
import { V1Namespace, V1NamespaceList, V1ObjectMeta, V1Pod, V1PodList, V1ListMeta } from './api.js';
@@ -887,18 +887,13 @@ describe('ListWatchCache', () => {
887887
});
888888
};
889889
const informer = new ListWatch('/some/path', mock.instance(fakeWatch), listFn);
890-
try {
890+
891+
throws(() => {
891892
informer.on('random' as any /* trick Typescript to allow this */, (obj) => {});
892-
fail('Unexpected lack of exception');
893-
} catch (err) {
894-
deepEqual(err, Error('Unknown verb: random'));
895-
}
896-
try {
893+
}, Error('Unknown verb: random'));
894+
throws(() => {
897895
informer.off('random' as any /* trick Typescript to allow this */, (obj) => {});
898-
fail('Unexpected lack of exception');
899-
} catch (err) {
900-
deepEqual(err, Error('Unknown verb: random'));
901-
}
896+
}, Error('Unknown verb: random'));
902897
});
903898

904899
it('should handle off with callbacks that are not registered', async () => {

0 commit comments

Comments
 (0)