11import { EngineRunResults , RuleDescription , RunOptions , Workspace } from "@salesforce/code-analyzer-engine-api" ;
2- import fs from "node:fs" ;
3- import * as os from "node:os" ;
4- import path from "path" ;
2+ import * as fs from "node:fs" ;
3+ import * as path from "path" ;
54import { TemplateEngine } from "../src/engine" ;
6- import { changeWorkingDirectoryToPackageRoot } from "./test-helpers" ;
5+ import { changeWorkingDirectoryToPackageRoot , createDescribeOptions , createRunOptions } from "./test-helpers" ;
76
87changeWorkingDirectoryToPackageRoot ( ) ;
98
@@ -41,7 +40,7 @@ describe('Template Engine Tests', () => {
4140 // add more checks for specific rules, describe options, and logging events
4241 it ( 'When no workspace is provided, then all rules are returned' , async ( ) => {
4342 const engine : TemplateEngine = new TemplateEngine ( ) ;
44- const rules : RuleDescription [ ] = await engine . describeRules ( { logFolder : os . tmpdir ( ) } ) ;
43+ const rules : RuleDescription [ ] = await engine . describeRules ( createDescribeOptions ( ) ) ;
4544
4645 expect ( rules ) . toEqual ( ALL_EXPECTED_RULES ) ;
4746 } ) ;
@@ -64,11 +63,4 @@ describe('Template Engine Tests', () => {
6463 const expectedRulesJsonStr : string = ( await fs . promises . readFile ( path . join ( TEST_DATA_FOLDER , relativeExpectedFile ) , 'utf-8' ) ) ;
6564 return JSON . parse ( expectedRulesJsonStr ) as RuleDescription [ ] ;
6665 }
67-
68- function createRunOptions ( workspace : Workspace ) : RunOptions {
69- return {
70- logFolder : os . tmpdir ( ) ,
71- workspace : workspace
72- }
73- }
74- } ) ;
66+ } ) ;
0 commit comments