Fix tests syntax for jest

Most tests could not run with jest because of syntax difference between
the old test runner.
This commit is contained in:
Martin Fournier
2021-12-19 04:42:16 -05:00
parent 890b1df593
commit d1696148c4
5 changed files with 340 additions and 313 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ export function removeTrailingSlash(s: string): string {
* Checks whether a string is a valid filename. Only used for the filename itself,
* not the entire filepath
*/
function isValidFilename(filename: string): boolean {
export function isValidFilename(filename: string): boolean {
// Allows alphanumerics, hyphens, underscores, and percentage signs
// Must have a file extension
const regex = /^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/;
@@ -48,7 +48,7 @@ function isValidFilename(filename: string): boolean {
* Checks whether a string is a valid directory name. Only used for the directory itself,
* not an entire path
*/
function isValidDirectoryName(name: string): boolean {
export function isValidDirectoryName(name: string): boolean {
// Allows alphanumerics, hyphens, underscores, and percentage signs.
// Name can begin with a single period, but otherwise cannot have any
const regex = /^.?[a-zA-Z0-9_-]+$/;