Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { mount, shallow } from 'enzyme';
import * as React from 'react';
import { ErrorSeverity, ErrorType, SourceError } from 'js-slang/dist/types';
import {
AutogradingResult,
ITestcase,
TestcaseTypes
} from '../../../../components/assessment/assessmentShape';
import Autograder, { AutograderProps } from '../Autograder';
const mockErrors: SourceError[] = [
{
type: ErrorType.RUNTIME,
severity: ErrorSeverity.ERROR,
location: { start: { line: 3, column: 11 }, end: { line: 3, column: 11 } },
explain() {
return `Name a not declared.`;
},
elaborate() {
return `Name a not declared.`;
}
}
];
// The five testcases have statuses: correct, (none), correct, incorrect and error
const mockPublicTestcases: ITestcase[] = [
{ program: `"string";`, score: 0, answer: `"string"`, result: `string` },
{ program: `fibonacci(2);`, score: 1, answer: `2` },
{ program: `fibonacci(3);`, score: 1, answer: `2`, result: 2 },