diff --git a/package.json b/package.json index ba19643..62d13ad 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "scripts": { "start": "ts-node ./src/bin.ts", - "build": "rm -rf ./dist && tsc", + "build": "rm -rf ./dist && tsc && np", "test": "uvu -r ts-node/register test -i fixtures", "dev": "ts-node test.ts", "cli": "ts-node src/bin.ts tests/test.ts", @@ -53,6 +53,7 @@ "@types/yargs": "^17.0.13", "concurrently": "^5.3.0", "git-cz": "^4.9.0", + "np": "^7.6.2", "ts-node": "^10.9.1" }, "files": [ diff --git a/types/Context.d.ts b/types/Context.d.ts index 1dbd237..c98737d 100644 --- a/types/Context.d.ts +++ b/types/Context.d.ts @@ -1,8 +1,9 @@ -import IStrategy from './IStrategy'; +import IStrategy from "./IStrategy"; export default class Context { private strategy; constructor(strategy: IStrategy); setStrategy(strategy: IStrategy): void; runTest(tsFile: string, jsFile: string): void; - runTests(dir: String): void; + runTsTestFiles(files: string[]): any; + private _runTsTestFile; } diff --git a/types/Utils.d.ts b/types/Utils.d.ts index 814a947..4a45109 100644 --- a/types/Utils.d.ts +++ b/types/Utils.d.ts @@ -1,3 +1,6 @@ export declare function Debug(name?: string): any; export declare function DebugWith(key: String): any; export declare function get_closest_package_json(): any; +export declare function getFiles(rest: any): string[]; +export declare function getCompileFiles(testFiles: string[]): string[]; +export declare function unique(arr: string[]): string[]; diff --git a/types/index.d.ts b/types/index.d.ts index 32c2bb5..55c4f24 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -7,6 +7,5 @@ export * from "./parse"; export * from "./loadObject/scan"; export * from "./loadObject/require"; export * from "./loadObject/flatten"; -export declare function executeWithDefaultStrategy(dirs: string[]): void; -export declare function executeFileWithDefaultStrategy(testFiles: string[]): void; -export declare function execute(rest: any): void; +export declare function runCli(rest: any): void; +export declare function run(rest: any): void; diff --git a/types/loadObject/scan.d.ts b/types/loadObject/scan.d.ts index 29b4db5..a7819ff 100644 --- a/types/loadObject/scan.d.ts +++ b/types/loadObject/scan.d.ts @@ -1,5 +1,11 @@ +export declare function clearCache(): void; +export declare function getAllTsFiles(dirs: string[]): any[]; export declare function getTsFiles(dir: string): {}; -export declare function load(file: string): { +export declare function loadFromDecorator(file: string): { clz_name: any; newClz: any; }; +export declare function loadFromCache(file: string): Promise<{ + clz_name: any; + newClz: any; +}>; diff --git a/types/watch.d.ts b/types/watch.d.ts index 94a1580..a788489 100644 --- a/types/watch.d.ts +++ b/types/watch.d.ts @@ -1,3 +1,2 @@ -import Context from './Context'; -export declare function WatchDir(dirs: string[], context: Context): void; -export declare function WatchFile(testFile: string, context: Context): void; +import Context from "./Context"; +export declare function WatchFiles(testFiles: string[], context: Context): void;