Add a type to represent local and remote files

This commit is contained in:
Josh Gross
2023-02-06 15:39:44 -05:00
parent 13aaa381c8
commit f28384e7ea
5 changed files with 104 additions and 4 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ import {convertWorkflowTemplate} from "./model/convert";
import {TraceWriter} from "./templates/trace-writer";
import {File} from "./workflows/file";
import {FileProvider} from "./workflows/file-provider";
import {fileIdentifier, FileReference} from "./workflows/file-reference";
import {parseWorkflow} from "./workflows/workflow-parser";
interface TestOptions {
@@ -61,8 +62,8 @@ describe("x-lang tests", () => {
}
const testFileProvider: FileProvider = {
getFileContent: async (fileName: string) => {
const file = reusableWorkflows[fileName];
getFileContent: async (ref: FileReference) => {
const file = reusableWorkflows[fileIdentifier(ref)];
if (file) {
return file;
}