mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 23:27:55 +02:00
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:
@@ -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_-]+$/;
|
||||
|
||||
Reference in New Issue
Block a user