Skip to content

Commit 7299f33

Browse files
committed
test(compiler): add unit test for file id generator
1 parent a02cd20 commit 7299f33

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { describe, it, expect } from 'vitest';
2+
import { generateFileId } from './id';
3+
4+
describe('generateFileId', () => {
5+
it('should generate the same id for both windows and unix relative paths', () => {
6+
const windowsPath = 'src\\components\\Button.tsx';
7+
const unixPath = 'src/components/Button.tsx';
8+
const nonce = 0;
9+
10+
const windowsId = generateFileId(windowsPath, nonce);
11+
const unixId = generateFileId(unixPath, nonce);
12+
13+
expect(windowsId).toBe(unixId);
14+
});
15+
});

0 commit comments

Comments
 (0)