private checkSize (size: number): void {
if (!Number.isSafeInteger(size)) {
throw new TypeError(
- `Invalid circular buffer size: ${size} is not an integer`
+ `Invalid circular buffer size: '${size}' is not an integer`
)
}
if (size < 0) {
private checkSize (size: number): void {
if (!Number.isSafeInteger(size)) {
throw new TypeError(
- `Invalid fixed priority queue size: ${size} is not an integer`
+ `Invalid fixed priority queue size: '${size}' is not an integer`
)
}
if (size < 0) {
it('Verify that circular buffer size is valid at instance creation', () => {
expect(() => new CircularBuffer(0.25)).toThrow(
- new TypeError('Invalid circular buffer size: 0.25 is not an integer')
+ new TypeError("Invalid circular buffer size: '0.25' is not an integer")
)
expect(() => new CircularBuffer(-1)).toThrow(
new RangeError('Invalid circular buffer size: -1 < 0')
)
expect(() => new CircularBuffer(Number.MAX_SAFE_INTEGER + 1)).toThrow(
new TypeError(
- `Invalid circular buffer size: ${
+ `Invalid circular buffer size: '${
Number.MAX_SAFE_INTEGER + 1
- } is not an integer`
+ }' is not an integer`
)
)
})
// describe('Fixed priority queue test suite', () => {
// it('Verify constructor() behavior', () => {
// expect(() => new FixedPriorityQueue('')).toThrow(
-// new TypeError('Invalid fixed priority queue size: is not an integer')
+// new TypeError('Invalid fixed priority queue size: '' is not an integer')
// )
// expect(() => new FixedPriorityQueue(-1)).toThrow(
// new RangeError('Invalid fixed priority queue size: -1 < 0')