mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 08:56:20 +00:00
33 lines
780 B
JavaScript
33 lines
780 B
JavaScript
import test from 'supertape';
|
|
import {parseError} from './parse-error.mjs';
|
|
|
|
test('user-menu: parse-error', (t) => {
|
|
const result = parseError({
|
|
lineNumber: 1,
|
|
columnNumber: 2,
|
|
});
|
|
|
|
const expected = [1, 2];
|
|
|
|
t.deepEqual(result, expected);
|
|
t.end();
|
|
});
|
|
|
|
test('user-menu: parse-error: stack', (t) => {
|
|
const stack = `
|
|
ReferenceError: s is not defined
|
|
at eval (eval at module.exports (get-user-menu.js:NaN), <anonymous>:1:2)
|
|
at module.exports (get-user-menu.js:6)
|
|
at tryCatch (VM12611 try-catch.js:7)
|
|
at AsyncFunction.show (index.js:67)
|
|
`;
|
|
|
|
const result = parseError({
|
|
stack,
|
|
});
|
|
|
|
const expected = [1, 2];
|
|
|
|
t.deepEqual(result, expected);
|
|
t.end();
|
|
});
|