Skip to content

Commit

Permalink
Update test for rootResolve function
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedsalem401 committed Sep 2, 2024
1 parent b0ff6af commit cc16dcf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 6 additions & 13 deletions test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,13 @@ describe('utils', () => {
});
});

// TODO: Fix this test as we can't mock the process.cwd
// describe('rootResolve', () => {
// jest.mock('process', () => ({
// cwd: () => 'mocked value'
// }));
describe('rootResolve', () => {
it('should resolve a relative path to an absolute path', () => {
const result = rootResolve('src/index.js');

// it('should resolve a relative path to an absolute path', () => {
// const cwd = 'test/project';

// const result = rootResolve('src/index.js');

// expect(result).toBe(path.join(cwd, 'src/index.js'));
// });
// });
expect(result).toBe(path.join(process.cwd(), 'src/index.js'));
});
});

describe('originalRequire', () => {
it('should return the original require.resolve function', () => {
Expand Down

0 comments on commit cc16dcf

Please sign in to comment.