-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compile): compile single test (#1337)
* chore(compile): improved imports of internal funcs * feat(compile): added single test file compilation
- Loading branch information
1 parent
aee63ef
commit 0d0e7fb
Showing
20 changed files
with
243 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import { Target, isTestFile } from '@sasjs/utils' | ||
import { getAllFolders, SasFileType } from './' | ||
import path from 'path' | ||
import { Target } from '@sasjs/utils' | ||
import { getAllFolders, SasFileType } from './getAllFolders' | ||
|
||
export const identifySasFile = async ( | ||
target: Target, | ||
sourcePath: string | ||
): Promise<'job' | 'service'> => { | ||
): Promise<SasFileType> => { | ||
if (isTestFile(sourcePath.split(path.sep).pop() as string)) { | ||
return SasFileType.Test | ||
} | ||
|
||
const serviceFolders = await getAllFolders(target, SasFileType.Service) | ||
|
||
const isService = serviceFolders.find((folder) => sourcePath.includes(folder)) | ||
if (isService) return 'service' | ||
if (serviceFolders.find((folder) => sourcePath.includes(folder))) { | ||
return SasFileType.Service | ||
} | ||
|
||
const jobFolders = await getAllFolders(target, SasFileType.Job) | ||
|
||
const isJob = jobFolders.find((folder) => sourcePath.includes(folder)) | ||
if (isJob) return 'job' | ||
if (jobFolders.find((folder) => sourcePath.includes(folder))) { | ||
return SasFileType.Job | ||
} | ||
|
||
throw 'Unable to identify file as Service or Job' | ||
throw `Unable to identify file as ${SasFileType.Service}, ${SasFileType.Job} or ${SasFileType.Test}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export * from './checkCompileStatus' | ||
export * from './compareFolders' | ||
export * from './compileFile' | ||
export * from './compileTestFile' | ||
export * from './copySyncFolder' | ||
export * from './getAllFolders' | ||
export * from './getDestinationPath' | ||
export * from './identifySasFile' | ||
export * from './loadDependencies' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.