Skip to content

Conversation

@timfish
Copy link
Collaborator

@timfish timfish commented Jan 10, 2024

The default basePath for createGetModuleFromFilename is dirname(process.argv[1]):

/** Creates a function that gets the module name from a filename */
export function createGetModuleFromFilename(
  basePath: string = dirname(process.argv[1]),

But the tests used a trailing slash for the base path:

const getModuleFromFilenameWindows = createGetModuleFromFilename('C:\\Users\\Tim\\', true);
const getModuleFromFilenamePosix = createGetModuleFromFilename('/Users/Tim/');

Which means in some situations the module name can include a leading ..

The tests need to pass without a trailing slash on the basePath!

@timfish timfish requested a review from lforst January 10, 2024 19:16
@timfish timfish marked this pull request as draft January 10, 2024 23:47
@timfish timfish marked this pull request as ready for review January 11, 2024 00:31
@lforst lforst merged commit 840a307 into getsentry:develop Jan 11, 2024
@timfish timfish deleted the fix/module-name branch January 11, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants