UNPKG

@sasjs/cli

Version:

Command line interface for SASjs

24 lines (23 loc) 1.65 kB
import { CompileTree, Target } from '@sasjs/utils'; import { TestFlow } from '../../../types'; /** * Resolves the relative destination fragment for a compiled test file inside * `sasjsbuild/tests` - either just the file's basename (saveToRoot, used for * testSetUp/testTearDown), or the path fragment following the build * destination folder name (used for service/job test files). * * `filePath` for testSetUp/testTearDown comes straight from a user's * sasjsconfig.json, which conventionally uses forward slashes for * portability - it is not guaranteed to match the current OS's separator. * Splitting on both `/` and `\` (instead of only `path.sep`) means this * works whether the config was authored with POSIX-style paths and the CLI * is running on Windows (`path.sep === '\\'`) or vice versa. Splitting on * `path.sep` alone silently no-ops when the string contains none of that * separator, leaving the whole config path intact and producing a nested * `sasjsbuild/tests/sasjs/tests/testsetup.sas` instead of a flat * `sasjsbuild/tests/testsetup.sas`. */ export declare const getTestFileDestinationFragment: (filePath: string, buildDestinationFolderName: string | undefined, saveToRoot: boolean) => string; export declare function compileTestFile(target: Target, filePath: string, testVar: string | undefined, saveToRoot: boolean | undefined, removeOriginalFile: boolean | undefined, compileTree: CompileTree, destinationPath?: string): Promise<void>; export declare function copyTestMacroFiles(folderAbsolutePath: string): Promise<void>; export declare const compileTestFlow: (target: Target) => Promise<TestFlow | undefined>;