- refactor array equality check and add tests - remove OperatingSystem.Unknown causing extra logic, return undefined instead - refactor enum validation to share same logic - refactor scripting language factories to share same logic - refactor too many args in runCodeAsync - refactor ScriptCode constructor to reduce complexity - fix writing useless write to member object since another property write always override it
15 lines
760 B
TypeScript
15 lines
760 B
TypeScript
import 'mocha';
|
|
import { SyntaxFactory } from '@/application/Parser/Script/Syntax/SyntaxFactory';
|
|
import { ScriptingLanguage } from '@/domain/ScriptingLanguage';
|
|
import { ShellScriptSyntax } from '@/application/Parser/Script/Syntax/ShellScriptSyntax';
|
|
import { BatchFileSyntax } from '@/application/Parser/Script/Syntax/BatchFileSyntax';
|
|
import { ScriptingLanguageFactoryTestRunner } from '../../../Common/ScriptingLanguage/ScriptingLanguageFactoryTestRunner';
|
|
|
|
describe('SyntaxFactory', () => {
|
|
const sut = new SyntaxFactory();
|
|
const runner = new ScriptingLanguageFactoryTestRunner()
|
|
.expect(ScriptingLanguage.shellscript, ShellScriptSyntax)
|
|
.expect(ScriptingLanguage.batchfile, BatchFileSyntax);
|
|
runner.testCreateMethod(sut);
|
|
});
|