• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

overlookmotel / livepack / 6852471427

13 Nov 2023 03:57PM UTC coverage: 90.535% (+0.06%) from 90.477%
6852471427

push

github

overlookmotel
Support `super` in arrow functions in `eval()` [fix]

Fixes #308.

4683 of 5027 branches covered (0.0%)

Branch coverage included in aggregate %.

15 of 22 new or added lines in 2 files covered. (68.18%)

12631 of 14097 relevant lines covered (89.6%)

12892.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

56.86
/lib/shared/assertBug.js
1
/* --------------------
62✔
2
 * livepack module
62✔
3
 * Assertion function for bugs
62✔
4
 * ------------------*/
62✔
5

62✔
6
'use strict';
62✔
7

62✔
8
// Modules
62✔
9
const {isFunction} = require('is-it-type');
62✔
10

62✔
11
// Exports
62✔
12

62✔
13
/**
62✔
14
 * Assert with error message including request to file an issue in Livepack repo.
62✔
15
 * Use this function for sanity checks - conditions which should never arise if everything is working.
62✔
16
 * @param {*} condition - Condition - if falsy, error will be thrown
62✔
17
 * @param {string} [message] - Error message
62✔
18
 * @param {string} [explanation] - Further context for error
62✔
19
 * @param {Function} [getDiagnostics] - Function to run to get diagnostic details
62✔
20
 * @throws {Error} - If assertion fails
62✔
21
 * @returns {undefined}
62✔
22
 */
62✔
23
module.exports = function assertBug(condition, message, explanation, getDiagnostics) {
62✔
24
        if (condition) return;
113,954✔
25

×
26
        if (!message) message = 'Unknown error';
×
27
        if (isFunction(explanation)) {
×
28
                getDiagnostics = explanation;
×
29
                explanation = null;
×
30
        }
×
31

×
32
        let helpMsg = `${message}.\n`;
×
33
        if (explanation) helpMsg += `${explanation}.\n`;
×
34
        helpMsg += 'This is likely a bug in Livepack.\nPlease raise an issue at https://github.com/overlookmotel/livepack/issues';
×
35
        if (getDiagnostics) {
×
36
                helpMsg += ' including the following details:\n';
×
37
                helpMsg += getDiagnostics();
×
38
        }
×
39

×
40
        console.error(helpMsg); // eslint-disable-line no-console
×
41

×
42
        const err = new Error(message);
×
43
        Error.captureStackTrace(err, assertBug);
×
44
        throw err;
×
45
};
62✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc