There is another approach for a readonly direct override. @Mostafa Fakhraei did it via a data descriptor - value and a writable flag). There is accessor descriptor - getter & setter. It is:
Object.defineProperty(queue, "CHUNK_SIZE", {
get: () => 1,
})
Then the result will look like
it('should return true for chunk_size 1', async () => {
Object.defineProperty(queue, "CHUNK_SIZE", { get: () => 1 })
const actual = await queue.post({ action: 'UPDATE' });
expect(actual).toBeTruthy();
});
No setter and only getter to be readonly.
More details about the Object.defineProperty() including enumerable, configurable flags are here.