All files / src/compiler/utils assert.js

88.88% Statements 16/18
50% Branches 1/2
50% Functions 1/2
88.88% Lines 16/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 192x 2x 2x 2x 2x 2x     2x 2x 2x 2x 2x 2x 2x 2x 230x 230x  
/**
 * @template T
 * @param {T} value
 * @returns {asserts value is NonNullable<T>}
 */
export function ok(value) {
	if (!value) throw new Error('Assertion failed');
}
 
/**
 * @template T
 * @param {any} actual
 * @param {T} expected
 * @returns {asserts actual is T}
 */
export function equal(actual, expected) {
	if (actual !== expected) throw new Error('Assertion failed');
}