Skip to content

Commit

Permalink
testing .....
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Duda committed Apr 11, 2024
1 parent 2214a35 commit a7ae75d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 1 addition & 3 deletions test/_utils/globals.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { resolve } from "path";

// Common test constants

export const TEMP_TEST_FOLDER = resolve("./TEST_TMP");
export const TEMP_TEST_FOLDER = "./TEST_TMP";
13 changes: 12 additions & 1 deletion test/_utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve, join } from "path";
import { existsSync } from "fs";
import { existsSync, stat } from "fs";
import { copySync } from "fs-extra";

import rimraf from "rimraf";
Expand Down Expand Up @@ -34,6 +34,17 @@ export const purgeMockRepository = () => {
// Temp folder

export const assertTemporaryFolderExists = () => {
stat(TEMP_TEST_FOLDER, function(err, stats) {
console.debug(stats);

if (!err) {
console.log('file or directory exists');
}
else if (err.code === 'ENOENT') {
console.log('file or directory does not exist');
}
});

if (!existsSync(TEMP_TEST_FOLDER)) {
throw new Error(`Temporary folder '${TEMP_TEST_FOLDER}' does not exist`);
}
Expand Down

0 comments on commit a7ae75d

Please sign in to comment.